homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

Sound restarting at Home label

5+ Year Member

Msg#: 3984420 posted 10:34 pm on Sep 4, 2009 (gmt 0)

I got the sound to play through the different labels. I just can't seem to figure out why it starts over when I go over to the Home Label. I'm guessing I have to some how check and see if the file is playing and if it is then create some if else statement. I just don't know how to do it.

Home Label action

var mySound:Sound = new Sound(this);
mySound.loadSound("music/music.mp3", true);//Set true to stream
mySound.onSoundComplete = function() {//loop it



WebmasterWorld Senior Member rocknbil us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 3984420 posted 7:03 pm on Sep 5, 2009 (gmt 0)

Being your label action, whenever you hit the label it's creating a new instance of the sound and playing it, overwriting the old same-named instance.

What might be better is to define the sound and sound source in the first frame then hit play on mouse over of label?

Here's a quick copy/paste from one of my players, but it has a start and stop button. The start/stop buttons are on top of each other, so when playing it turns into a stop button and vice versa. You can guess the other symbols I have by what I've named them. All in an actions layer, entire player is one frame.

var soundOn;
mySound = new Sound();
mySound.onSoundComplete = function() { toggleSound(); };
function toggleSound() {
if (soundOn==1) {
else {


5+ Year Member

Msg#: 3984420 posted 4:46 pm on Sep 11, 2009 (gmt 0)

Thanks I ended up just making the sound file to its on clip and loading it

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved