Help Please - 2 Questions

Ok. I am making small animation in flash. The animation will be about a minute long and when it is done it will just go back to the first frame and repeat itself. So there are 2 things I would like to know how to do.

  1. Each time the animation starts over again at frame 1 I want to different mp3. So if it loops 10 times it will play 10 songs.

  2. I also would like to have a counter that will count how many times the animation starts at frame 1. So if the animation loops 15 times then the counter will show 15.

Is this possible? Any help would be greatly appreciated.

the counter is not a problem. at frame 1 you’d have something like this:

count++;

then just place a dynamic text field on the stage and put count in the var field in the properties panel

as for the sound … do you want to load it dynamically or attach it from the library?

ok thanks…i can handle that for sure

and sound…im pretty sure i want to do it from the library

dynamically works best doesnt it?

hmmm … interesting question :stuck_out_tongue:

i guess it depends on the size of the mp3’s … ??

if the animation is too small maybe it won’t be time enough to load the mp3’s dynamically … but if you have the mp3’s in the library you’d need to load them all at once and the movie would load slowly

i’m not that worried about size…dynamically would be nice if it would work though


songs = ["song1.mp3", "song2.mp3", "song3.mp3"];
mysound = new Sound();
mySound.stop();
mySound.loadSound(songs[Number(count)], true);

then something like that should work …

[size=1]note. i didn’t test it :P[/size]

i forgot to say …

paste the script before the count++; or the first song will never be loaded :slight_smile:

thanks Kax…ill give it a try and let you know how i make out…never expected help this quickly

no problem diggler :slight_smile:

if you have any problems just ask :wink: