-
Code for stopping and starting music
I'm making a platform game and I want to start a music track playing, and when I reach a certain keyframe (keyframe 2 for example) the music that was playing stops, and a different track plays.
Ex: Mario is walking along with his happy little theme tune playing and all of the sudden Bowser comes by and the happy music shuts off and boss music starts playing.
Thanks in advance.
-
var my_sound:Sound = new Sound();
my_sound.attachSound("music1");
my_sound.start();
After certain key frame
my_sound.stop();
my_sound.attachSound("music2");
my_sound.start();
-
Originally Posted by brainstormingin
var my_sound:Sound = new Sound();
my_sound.attachSound("music1");
my_sound.start();
After certain key frame
my_sound.stop();
my_sound.attachSound("music2");
my_sound.start();
Sounds good! I'll try it out and let you know. Thanks!
-
Worked like a charm!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|