maryus
01-30-2009, 03:57 PM
Hi. I have a fla whose main timeline stops at frame 25, where this code is called:
stop();
myMusic = new Sound(this);
myMusic.attachSound("mySound");
myMusic.start(0, 999);
slider.control._y = -50;
slider.control.onEnterFrame = function() {
myMusic.setVolume(0-this._y);
}
slider.control.onPress = function() {
startDrag(this, false, this._x, -100, this._x, 0);
}
slider.control.onRelease = function() {
stopDrag();
}
The frame holds a soundtrack (that is, "mySound"), looping 999 times, set as event and repeat (the slider controls well, control a volume slide, you know).
Still in the frame 25, I have a button that pops a window (let's call it "holder") from a resident MC, which loads in itself an external swf, where I have a main timeline made of 3 frames; the first has a preloader, the 2d has 1 button, with this action
on(release){StopAllSounds();gotoAndStop("playthemusic");}
where the frame labeled "playthemusic" (the third of them, obviously) holds another soundtrack, linked as "sd1"; I putted "StopAllSounds" in order to stop the parent soundtrack (but I dunno whether there was a better method), so it won't overlap "sd1".
In the resident MC, I have a button, which closes the "holder" window and unloads its external MC, and which (in my intentions) had to start again the soundtrack of the main timeline's frame 25.
My question is: what code should I put in that button, in order to restart the sound? Please help. Thanks.
stop();
myMusic = new Sound(this);
myMusic.attachSound("mySound");
myMusic.start(0, 999);
slider.control._y = -50;
slider.control.onEnterFrame = function() {
myMusic.setVolume(0-this._y);
}
slider.control.onPress = function() {
startDrag(this, false, this._x, -100, this._x, 0);
}
slider.control.onRelease = function() {
stopDrag();
}
The frame holds a soundtrack (that is, "mySound"), looping 999 times, set as event and repeat (the slider controls well, control a volume slide, you know).
Still in the frame 25, I have a button that pops a window (let's call it "holder") from a resident MC, which loads in itself an external swf, where I have a main timeline made of 3 frames; the first has a preloader, the 2d has 1 button, with this action
on(release){StopAllSounds();gotoAndStop("playthemusic");}
where the frame labeled "playthemusic" (the third of them, obviously) holds another soundtrack, linked as "sd1"; I putted "StopAllSounds" in order to stop the parent soundtrack (but I dunno whether there was a better method), so it won't overlap "sd1".
In the resident MC, I have a button, which closes the "holder" window and unloads its external MC, and which (in my intentions) had to start again the soundtrack of the main timeline's frame 25.
My question is: what code should I put in that button, in order to restart the sound? Please help. Thanks.