[ F5 ] HOW do I limit a sound loop?

Here’s the situation, I’ll try to be clear and concise:

**Say you have a single-scene 170 frame long movie.
**The first two frames contain a preloader function.
**Following the preloader is a very short introduction.
**Then, the real stuff begins including a background SOUND LOOP that begins at say frame 70.
**Now here’s the actual problem: I want the sound loop to only play between frames 70 and 170. Nowhere else, especially not over the preloader if someone happens to restart the movie.

-Which is what happens now. It plays fine the first time, but then the loop just keeps going and going no matter what.

I need control. ANY SOLUTIONS?

In the first frame of the movie, include a


moviesound = new Sound();
moviesound.attachSound("linkage name")

In frame 70, add this code:


moviesound.start([1]);

This will make it loop only once. If you’d like it to loop constantly until frame 170, however then in frame 70 add only:


moviesound.start();

and in frame 1 add


moviesound.stop();

idName is the linkage name to your sound clip in the Library. (Click Import to Library from the File menu, then right-click the sound in the library and select “linkage”… make sure Export for ActionScript and Export in First Frame are checked).

This should work!

  • wobbly

Wobblyfork!
You have just saved me!

“Thank you wobblyfork, you were my only hope!”

Thank you Wobblyfork!
Days of working up to this one last point which just would not work… ARE OVER.

All I wanna do is to thank you even though I don’t know who you are.

:slight_smile: :slight_smile:

:beam: No problem! Glad I helped.

  • wobbly