Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

easy question about looping animations

Status
Not open for further replies.

Ssanai80

IS-IT--Management
Jun 28, 2001
21
0
0
US
i'm new to flash, and i think this should be faily an easy question.
I have a flash animation on my site that keeps looping forver. how can i make the animation to loop only twice(or however many times)then stop at a certain frame during the second loop?
thank you in advance for help
 
ok...here goes...
1st key frame, make it blank with

Set (Count, 0)

As the actionscript. On the second keyframe, put this...

Count = Count + 1

And at the end of the animation, put this code...

if (Count<2) {
gotoAndPlay (2);
}

if (Count>2) {
gotoandstop (26)
}

Now, set the gotoandstop to the last frame, and set the 2 counts, and play around with them for in the IF functions...
I didn't spend much time on this, so it's VERY sloppy, and not exactly the best code, but its code that works. ----------------------------------------
Insert attention grabbing signature, which would otherwise provoke a positive emotion here.
 
Ssanai80,

Put a stop(); action in the last frame of your movie. It is better, although not necessary but for the sake of clarity, to do this on a separate layer (named actions), and you must insert a keyframe in the last frame before you add that stop action.
While playing and testing the movie, enable simple actions under Control-> Enable Simple Frame Actions.
If you used Publish to output an html, make sure you uncheck the loop box on the html tab.

As for your second question, since the movie will now stop at the end and not run again, you wont have a second loop. The only way to do that, would be to used a conditional stop action on that last frame, such as:
(if onlyhasplayedonce = false
set the variable to true
replay another time
& with another conditional action
have it stop on some frame)


...But then what?
;-)ldnewbie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top