-
HELP! sound object stop kills flv sound too
code:
if (!firstTime) {
_root.introMusic = new Sound();
_root.introMusic.attachSound("music");
_root.introMusic.setVolume(50);
_root.introMusic.start(0, 1);
firstTime = true;
}
music_btn.onRelease = function() {
if (!rockNow) {
_root.introMusic.setVolume(0);
this.gotoAndStop(2);
rockNow = true;
} else {
_root.introMusic.setVolume(50);
this.gotoAndStop(1);
rockNow = false;
}
};
stop();
This script for my "music on/off" btn kills ALL audio and not just the sounds object audio. It also pauses FLV playback (I'm using the FLVplayback component). Any insite?
I've tried modifying the above AS not using the "_root." to target the obj and also stop() and start() on the obj instead of just volume control. HELP!!!
Thanks,
1M.
-
http://pat.theorigin.net
add (this) to your Sound declaration:
Code:
if (!firstTime) {
_root.introMusic = new Sound(this);
_root.introMusic.attachSound("music");
_root.introMusic.setVolume(50);
_root.introMusic.start(0, 1);
firstTime = true;
}
-
still no love
I tried that and even switched "this" to "_root" and it still didn't work. The "music off" btn still mutes all FLVs.
Help!
Thanks,
1M.
-
http://pat.theorigin.net
you changed your first line to look like this?
Code:
_root.introMusic = new Sound(this);
-
indeed, I did. I'm attempting to load the MP3 externally and forgo the 'attachSound' function.
... The "_root.introMusic = new Sound(this);" didn't fix the issue at present....
Thanks,
1M.
-
kill the attachSound
I switched my code to call the sound external and it now works.
code:
if (!firstTime) {
_root.introMusic = new Sound();
_root.introMusic.onLoad = function(success:Boolean) {
if (success) {
_root.introMusic.start();
_root.introMusic.setVolume(50);
} else {
trace("Sound failed");
}
};
_root.introMusic.loadSound("music.mp3", true);
firstTime = true;
}
stop();
music_btn.onRelease = function() {
if (!rockNow) {
_root.introMusic.setVolume(0);
this.gotoAndStop(2);
rockNow = true;
} else {
_root.introMusic.setVolume(50);
this.gotoAndStop(1);
rockNow = false;
}
};
I hate not finding the proper solution, but I like meeting deadlines more.
Thanks,
1M.
-
you can try this:
var mc = _root.createEmptyMovieClip("mc",1);
_root.introMusic = new Sound(mc);
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
|