flash question

Out of context: Reply #2

  • Started
  • Last post
  • 10 Responses
  • ahli0

    This is a start for you, take the Timer out and code in buttons :)

    //Get the LoaderMax and GreenSock classes at http://www.greensock.com/

    import com.greensock.*;
    import com.greensock.loading.*;
    import com.greensock.events.LoaderEvent...
    import com.greensock.loading.display.*;

    var xml:XMLLoader;
    var images;
    var current = 0;
    var previous;

    function init(){
    LoaderMax.activate([ImageLoader...
    xml = new XMLLoader("images.xml", {name:"images", onComplete:onXmlLoaded});
    xml.load();
    }

    function onXmlLoaded(e){
    images = LoaderMax.getContent("images");
    nextImage();

    }

    function nextImage(){

    TweenLite.from(images[current],1...
    onStart:function(){
    addChild(images[current]);
    },
    onComplete:function(){
    if(previous){
    removeChild(images[previous])
    }
    previous = current;
    if(current<images.length-1){
    current++;
    }else{
    current=0;
    }
    setTimeout(nextImage,2000);
    }
    });
    }

    init();

View thread