Flash scripting question
- Started
- Last post
- 5 Responses
- CygnusZero40
It seems like when you click replay, its starting the music over, but its running that scrip again so the sound was already set to 25, well its adding it and setting it to 50.
On the replay button, how so I set the bgmusic sound to 0? This way when it starts over after that, it will set it to 25 again which is what I want.
- fyoucher10
Not sure what the problem is exactly since I don;t have the FLA or SWF but almost sounds like something is duplicating itself. Like you're creating another movieclip on top of it that does the same thing.
Maybe try this. When you replay, delete that sound container movieclip and then just recreate it again. If you need to remember the current volume for some reason, just put the volume value in another variable (again, not sure what you're doing exactly).
on replay...
soundContainer_mc.removeMovieCli...
... do code for new sound again.
- CygnusZero40
^ One problem Im having with that. Ive got a replay button at the end, when you hit it, its restarting the music, but it sounds a bit louder.
- fyoucher10
put bgmusic1 into it's own movieclip first. Looks like you're using AS2...
var soundContainer_mc: MovieClip = createEmptyMovieClip
("soundContainer_mc", this.getNextHighestDepth());var bgmusic1:Sound = new Sound (soundContainer_mc);
bgmusic1.setVolume(25);
- CygnusZero40
By the way I did that thing where you set the music to export for actionscript, and named it bgmusic1, so thats all good I think, I have no clue why even though the script aboveis targeting bgmusic1, its changing the volume of all the VO files as well.
- CygnusZero4
I have a flash project that has voiceover files in it as well as a background music file.
The voice sounds great, but I need to lower the volume of just the music through scripting. The problem is when I used the script below, it's changing all the audion, not just bgmusic.
bgmusic1 = new Sound();
bgmusic1.setVolume(25);