• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Loop banner 3 times and stop short of the end frame

Community Beginner ,
Nov 19, 2015 Nov 19, 2015

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?

TOPICS
ActionScript

Views

378

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 19, 2015 Nov 19, 2015

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();
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 20, 2015 Nov 20, 2015

Copy link to clipboard

Copied

I control the alpha via a timeline tween.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 20, 2015 Nov 20, 2015

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines