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!

Looping movie clips with dynamic frame rates

Status
Not open for further replies.

polyglot

Programmer
Nov 28, 2007
11
Hello-

I have a question. I am new to programming, Flash, and actionscript - so bear with me. I am trying to create a game with 3 different levels of difficulty. To do so, I need to create a movie clip with three different frame rates (essentially - three different movie clips). I got a great script somewhere to enable me to do this. It goes in the first frame of the movie clip whose frame rate is to be adjusted. Here it is:

function timelineFaster() {
nextFrame();
updateAfterEvent();
}
var tweenFaster:Number = setInterval(timelineFaster, 42);


(The "42" in the last line can be adjusted to make the timeline go faster or slower). Anyway - my question/problem is this: When I put this code in the first frame of my movie clip, the movie clip no longer loops. Can anyone send me the code I need to add to this frame that will allow the movie clip to loop? I believe this is probably an easy fix, but as I said - I am a babe in the woods when it comes to Flash, actionscript, and programming. I hope someone can post/send the code I need to force my movie clip to loop. Thanks!

Monica
 
Hey-

Never mind about this problem - I figured out the answer. In the last frame of the movie clip I put the following code:


gotoAndPlay(1);

clearInterval(tweenFaster);



It worked!

Monica :eek:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top