Hi...
Probably the best way to add an audio track to your movie would be to load the music file as a seperate swf file. By doing this you reduce the download time of the main movie considerably.
The following example uses the sound object:
1) Open up a new swf file. On frame 1 add the script:
mySound = new Sound();
mySound.attachSound("liabrarySound");
This action attaches your music track from the liabrary. To attach a file from the library:
a) Select your file in the liabrary, click the options button then choose 'Linkage'.
b) In the linkage panel choose 'export this symbol' and type the name you want to give your file. I opted for' liabrarySound'.
2) Place two buttons on your stage, on and off.
On the button to start your music:
on (release) {
mySound.start(1,100);
}
This action will start your music after 1 second and loop it 100 times.
3) Button to stop your music:
on (release) {
mySound.stop();
}
Save this movie to the same folder as your main movie. To load this movie into your main movie use the load movie action:
on (release) {
loadMovieNum ("musicFile.swf", 5);
}
This action will load your audio track into level 5.
Hope this helps.
|