FORUMS: list search recent posts

Flash loop

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Andrea Mandarino
Flash loop
on Mar 10, 2010 at 10:19:31 pm

How can I get a flash banner to loop 5 times than stop at a certain frame?


Return to posts index

demetri tashie
Re: Flash loop
on Mar 17, 2010 at 1:50:38 am

andrea,
if you are still looking at this thread and still need an answer :

there are different ways to do this. here is one simple way: turn your entire banner into a self contained movieclip symbol. give it an instance name of 'banner'. a variable 'i' is set as a counter. an event listener listens for when the banner clip reaches it's last frame, and advances the counter. it then stops when it reaches the last frame for the fifth time.

the 'banner' movieclip sits on the first frame of the timeline. there shouldn't be a need for more than this one frame.

this is the code that would then stop the banner/banenr clip after it finished it's fifth loop:

var i:uint=1;

banner.addEventListener(Event.ENTER_FRAME, enterFunction);
function enterFunction(evt:Event):void {
if (i==6) {
banner.stop();
} else {
if (banner.currentFrame==banner.totalFrames) {
i++;
}
}
}


hope that makes sense and helps.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]