-
Senior Member
Volume control for external SWF's
I'm trying to find a tutorial that will allow the user to control the volume of external SWF's that load after a particular button is clicked.
I don't want the volume control to affect the volume on my buttons, etc, only on the loaded SWF's.
Any ideas?
-
Lifesaver
Wow, that's a fun one. I'm not exactly sure how to go about it, but a few ideas come to mind.
Load your external SWFs into a MOVIE CLIP. Not a level (at least I don't think a level will work in this one...)
Make sure your MC has an instance name...like "loadedMovie".
Then, after the movie loads, you'll have to create a sound object:
mySubSound = new Sound(loadedMovie)
I think you should be able to control volume levels from there with mySubSound.setVolume()
-
Senior Member
Would it make life easier if I didn't care if the volume controls also affected the buttons sounds?
But back to your solution for a minute, it sounds like if I just follow one of the tutorials on creating a "sound object" and then follow one of the tutorials on making a volume slider it should work.
Hmmm. I'll have to try that over the weekend.
Thanks for the idea.
-
Lifesaver
No sweat. Ultimately, you could make it really easy and basic simply by using Macromedia's tutorial in the ActionScript reference on how to make a global sound object. You can do this by not defining a movie clip in your new Sound() object:
myGlobalSound = new Sound(); //this sound object can control ALL sounds in the Flash movie.
But, with what I mentioned, you should be able to localize that sound object to just loaded movie, as long as the movie has an instance name (I don't think new Sound(_level1) works...it might though--worth trying.)
Then, volume sliders are pretty easy. Just keep the value of the variable that the slider changes between 0 and 100, and use mySoundObject.setVolume(sliderVarValue) to dynamically change the volume.
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
|