Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var produto:String = new String("");
- var imageLoaded:Boolean = false;
- carregarProduto();
- /*----------- Loader section*/
- function carregarProduto(){
- if(currentFrame == 1){
- produto = "produto01.png";
- }
- else if(currentFrame == 2){
- produto = "produto02.png";
- }
- else if(currentFrame == 3){
- produto = "produto03.png";
- }
- else if(currentFrame == 4){
- produto = "produto04.png";
- }
- else if(currentFrame == 5){
- produto = "produto01.png";
- }
- go();
- }
- /*------------*/
- function go(){
- var request:URLRequest = new URLRequest(produto);
- var loader:Loader = new Loader();
- if(loader != null && contains(loader)){
- removeChild(loader);}
- loader.load(request);
- addChild(loader);
- }
- /*------------- Timer section*/
- var myTimer:Timer = new Timer(1000);
- myTimer.addEventListener(TimerEvent.TIMER, timerFunction);
- function timerFunction(event:TimerEvent):void
- {
- if(this.currentFrame < 5 ){
- nextFrame();
- carregarProduto();
- }
- else
- gotoAndStop(2);
- }
- myTimer.start();
- stop();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement