muting flash video and unmuting via a button

  • jlknauff
  • Expert
  • Expert
  • User avatar
  • Posts: 502
  • Loc: Florida

Post 3+ Months Ago

I have a flash file that contains a video, which I want to start muted, and when a visitor clicks a button the audio will play. The audio is part of the video, which will be running continuously. How can I do this?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

Make a sound object on the root timeline called "globalsound". Anything you do to that sound object will affect everything else in the movie including audio in an FLV.

Code: [ Select ]
var globalsound = new Sound();
globalsound.setVolume(0);

buttonName.onRelease = function(){
globalsound.setVolume(100);
}
  1. var globalsound = new Sound();
  2. globalsound.setVolume(0);
  3. buttonName.onRelease = function(){
  4. globalsound.setVolume(100);
  5. }


You can also target individual sounds if you have others playing and don't want to affect everything, but I haven't always gotten consistent results this way.

Code: [ Select ]
var mySound = new Sound(movieClipContainingSound);
  • dhonsvick
  • Beginner
  • Beginner
  • dhonsvick
  • Posts: 49

Post 3+ Months Ago

Also myMovie.volume = 0; aughta work if using the FLVPlayBack Component - Another thing to remember from the Network admin standpoint. If your site gets lots of hits ... dont start your movie until requested if you can help it.


Code: [ Select ]
var users_online:25;
var streaming_bitrate:Number = 250;
var available_bandwidth = 1544;

if((streaming_bitrate * users_online) > available_bandwidth) {
   trace("Kill me now");
} else{
   trace("hope it don't happen =)");
}
  1. var users_online:25;
  2. var streaming_bitrate:Number = 250;
  3. var available_bandwidth = 1544;
  4. if((streaming_bitrate * users_online) > available_bandwidth) {
  5.    trace("Kill me now");
  6. } else{
  7.    trace("hope it don't happen =)");
  8. }

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 16 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.