Copy link to clipboard
Copied
I'm making animated banners that loop 3 times from start to finish, the banner's contents alpha out on the ending frame, but on the third loop I would like the elements to stay visible and make the banner stop moving. How may I use Actionscript to accomplish this?
Copy link to clipboard
Copied
How do you control the alpha, via a timeline tween or a coded tween?
In any case you will need to start with having a loop counter so that you can tell when you have reached the desired end point 3 times. for that you could have something like the following in frame 1...
var count:Number;
if(isNaN(count)){
count = 0;
}
that will set the initial value of the count variable to zero but also keep the variable from resetting to 0 every time you return to that frame. Then in the frame where you desired to stop...
count += 1;
if(count == 3){
stop();
}
Copy link to clipboard
Copied
I control the alpha via a timeline tween.
Copy link to clipboard
Copied
Then either stop the third loop at the start of the tween before it fades, or if you want it to fade before stopping and then re-appear, place it at the end of the timeline and include a command to set the alpha back to 1 in the conditional.