PDA

View Full Version : when sound is playing



no bone movie
July 16th, 2003, 01:14 PM
hi, i'm having trouble with some as.
i want a mc to move onto frame 2 when an imported mp3 starts playing. i've found :



if (playing==true)
_root.soundbar.statusMC.gotoAndStop(2);


but it isn't working.

cheers.

kode
July 16th, 2003, 01:26 PM
Could you post the rest of your code?

no bone movie
July 16th, 2003, 01:32 PM
on (release) {
stopAllSounds();
track2 = new Sound();
track2.loadSound("track2.mp3", false);
track2.start(0, 99);
if (playing==true)
_root.soundbar.statusMC.gotoAndStop(2);
}


this is the code i have tried on the button, but no luck.
i really want the detection on it's own line so other tracks can be picked up.

cheers.

kode
July 16th, 2003, 01:36 PM
Well, you never set to true the variable playing.
I guess you could try using an onLoad handler instead. :)
track2.onLoad = function() {
_root.soundbar.statusMC.gotoAndStop(2);
};

no bone movie
July 16th, 2003, 01:46 PM
tried that before. just tried it again, no go. here's the fla.

cheers.

kode
July 16th, 2003, 01:52 PM
Try this:
on (release) {
stopAllSounds();
track2 = new Sound();
track2.onLoad = function() {
this.start(0, 99);
statusMC.gotoAndStop(2);
};
track2.loadSound("track2.mp3", false);
}

no bone movie
July 16th, 2003, 02:09 PM
that works sweet mate. aren't mp3s stored in the temp files when loaded this way?

cheers.

kode
July 16th, 2003, 02:17 PM
Yeah, I think so. :)

And you're welcome. ;)