POLALA.COM
welcome to my space
X
Search:  
Welcome to:polala.com
Web Design | Video Games | RVs | Religion | Management | Supplements and Vitamins | Software | Basketball | Related articles
NAVIGATION: Home >>
Need help with XML gallery
Published by: wktd 2009-01-07

  • Need help with XML Photo gallery/Slideshow
    Dear forumers,
    I need help with creating a automatic slideshow with control buttons.
    Have browsed through Kirupa's tutorials and have made references to the following 2 tutorials
    http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm
    http://www.kirupa.com/developer/mx2004/xml_slideshow.htm
    I am trying to combine the codes for these 2 tutorials so that I can have the images cycle automatically but at the same time with control buttons
    like "back", "next" and "pause".
    Please see below for my attempt..
    stop();
    delay = 3000;
    function loadXML(loaded) {
    if (loaded) {
    xmlNode = this.firstChild;
    image = ;
    image2 = ;
    image3 = ;
    description = ;
    total = xmlNode.childNodes.length;
    for (i=0; i image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
    image2[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
    image3[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
    description[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
    }
    firstImage();
    } else {
    content = "file not loaded!";
    }
    }
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    xmlData.load("images.xml");
    /////////////////////////////////////
    Key.addListener(listen);
    listen = new Object();
    listen.onKeyDown = function() {
    if (Key.getCode() == Key.LEFT) {
    prevImage();
    } else if (Key.getCode() == Key.RIGHT) {
    nextImage();
    }
    };
    Key.addListener(listen);
    previous_btn.onRelease = function() {
    prevImage();
    };
    next_btn.onRelease = function() {
    nextImage();
    };
    /////////////////////////////////////
    //------------ preloader
    p = 0;
    this.onEnterFrame = function() {
    filesize = picture.getBytesTotal();
    loaded = picture.getBytesLoaded();
    filesize = picture2.getBytesTotal();
    loaded = picture2.getBytesLoaded();
    filesize = picture3.getBytesTotal();
    loaded = picture3.getBytesLoaded();
    preloader._visible = true;
    if (loaded != filesize) {
    preloader.preload_bar._xscale = 100*loaded/filesize;
    preloader2.preload_bar._xscale = 100*loaded/filesize;
    preloader3.preload_bar._xscale = 100*loaded/filesize;
    } else {
    preloader._visible = false;
    if (picture._alpha<100) {
    ActionScript 1.0/2.0 [Archive] - Page 143 - kirupaForum::
    need help on finishing these tweens using Fuse. kirupa gallery I really need some help Flash/XML menu problem. scroll zoom, dynamic txt. flip with depth
    http://www.kirupa.com/forum/archive/index.php/f-9-p-143.html
    HOME
    picture._alpha += 10;
    }

    preloader2._visible = false;
    if (picture2._alpha<100) {
    picture2._alpha += 10;
    }
    preloader3._visible = false;
    if (picture3._alpha<100) {
    picture3._alpha += 10;
    }

    }
    };
    //------------ preloader
    function nextImage() {
    if (p<(total-1)) {
    p++;
    if (loaded == filesize) {
    picture._alpha = 0;
    picture.loadMovie(image[p], 1);
    picture2._alpha = 0;
    picture2.loadMovie(image2[p], 1);
    picture3._alpha = 0;
    picture3.loadMovie(image3[p], 1);
    desc_txt.text = description[p];
    picture_num();
    slideshow();
    }
    }
    }
    function prevImage() {
    if (p>0) {
    p--;
    picture._alpha = 0;
    picture.loadMovie(image[p], 1);
    picture2.loadMovie(image2[p], 1);
    picture3.loadMovie(image3[p], 1);
    desc_txt.text = description[p];
    //picture_num();
    }
    }
    function firstImage() {
    if (loaded == filesize) {
    picture._alpha = 0;
    picture.loadMovie(image[0], 1);
    picture2.loadMovie(image2[0], 1);
    picture3.loadMovie(image3[0], 1);
    desc_txt.text = description[0];
    //picture_num();
    slideshow();
    }
    }
    /*
    function picture_num() {
    current_pos = p+1;
    pos_txt.text = current_pos+" / "+total;
    }
    */
    //-- timer thing
    function slideshow() {
    myInterval = setInterval(pause_slideshow, delay);
    function pause_slideshow() {
    clearInterval(myInterval);
    if (p == (total-1)) {
    p = 0;
    firstImage();
    } else {
    nextImage();
    }
    }
    //function
    }

    Issue 1
    ------------
    I tried to assign the functions nextImage(); and prevImage(); into my 'next' and 'back' buttons respectively
    The automated slideshow works fine but there seems to be a bug somewhere whereby 'next' brings me to the next screen but
    right after that the other screens will jump about in wrong sequences.
    I have no wonder what is wrong as i am a beginner in AS.
    ------------
    Issue 2
    ------------
    I require a 'pause' button in my slideshow as well
    Is anyone kind enough to help me write a function that I can assign to my 'pause' button to make the slideshow pause?
    I see a pause_slideshow() within the slideshow() function but I do not really understand the codes, that is why I am having so much
    difficulty.
    Please help me! Thanks in advance :hugegrin:


  • Someone help me please.. i need this rather urgently..:azn:


  • Checking


  • Please refer rhamej XMl Gallery in kirupa


  • Thanks everyone!
    I have managed to find a solution to my problem
    Have made reference to an earlier thread :)

    http://www.kirupa.com/forum/showthread.php?t=92555

    :mario:


  • Please refer rhamej XMl Gallery in kirupa


    Hi thanks for your reply. I have tried searching for rhamej XML Gallery in kirupa but to no avail. Is it possible for me to give me the exact link? your help will be very much appreciated. Will appreciate more experts' help too :afro:





  • Where's The Advantage In Windows Genuine Advantage?
    Stocks Bounce After S&P Joins Bear Market

    PRINT Add to favorites
    #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Need help with XML gallery , Please add it free.
  • a few questions about baby p if anyone can help
  • are there any industries in the u s or the world that function in a true free market
  • question concerning pizza delivery drivers
  • anyone agree the economic meltdown is a good thing for america in the long run
  • has the economy been improving yet
  • is all the economic stimulus just postponing the economic crisis
  • the great depression and wwii
  • about hyperinflation
  • micro economics question need help
  • come on pirates in this day and age
  • will india or china ever overtake the us as a global super power
  • explain the difference between a properties assessed value and market value what impact does the current e
  • did the texas chainsaw messacre really happen
  • did miley cyrus die
  •  
  • how common is hidden camera crime in the us
  • baby peter s father why is he not being blamed too
  • when does glen beck start on fox news
  • how does the wto world trade organization affect international trade
  • do you think it would be a good idea for the auto workers to agree to a pay cut before we bail them out
  • when the dow rises now it seems to rise because of rumors and news rather than earnings reports why
  • sense the economy is so slow right now should i quite my job and go back to school
  • aggregate demand supply shifts question need help
  • our prisons are they tough enough
  • what country holds the largest supply of gold reserves and what is the value
  • how did the people in the usa such as the congressman who died in jonestown find out about what was going on t
  • was 9 11 a conspiracy
  • gas prices
  • About us |Contact us |Advertisement |Site map |Exchange links
    Copyright© 2008polala.com All Rights Reserved