A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] Unmute - Button that dissapears on click

  1. #1
    Junior Member
    Join Date
    Dec 2004
    Posts
    4

    resolved [RESOLVED] Unmute - Button that dissapears on click

    Hi all, I am very very new to action script, most of the flash I use is for banner animation etc.

    I am doing a video that I need to start playing automatically, but it has to start playing muted.

    For this part I am using the following code


    Code:
    vid.playPauseButton = playpauseVid;
    
    vid.volume = 0;
    vid._uiMgr._isMuted = true;
    vid.muteButton = mute;
    vid is my video instance name.

    This works great so far. But now the client wants to ad a big button over the video that says PLAY WITH SOUND. And that button has to serve the same function as the unmute button but it has to disappear once it is clicked.

    Is there a simple way to do this?


    Thanks so much



    -----------------------------------------------------


    I tried using this

    Code:
    cover.onPress = function(){ this._visible=false}
    But that only makes a button that disappears when I click it, how do I make that button unmute my video or how do I link it to this

    Code:
    vid.volume = 0;
    vid._uiMgr._isMuted = true;
    vid.muteButton = mute;
    --------------------------------------------------------------

    Ok I tried to add that disappear code to my already functioning mute button, what is happening is that it is applying the this._visible=false before it unmutes. So the button disappears before it has a chance to unmute the audio



    --------------------------------------------------------------


    Got it working.

    Credit to tacos over at actionscript.org

    Code:
    cover.onPress = function(){
        this._visible = false;
        vid.volume = 100;
    };
    
    
    
    vid.playPauseButton = playpauseVid;
    vid.volume = 0;
    vid._uiMgr._isMuted = true;
    vid.muteButton = mute;
    Last edited by JGomez3d; 07-20-2010 at 01:51 PM. Reason: Spelling

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi JGomez3d,

    Glad it's solved.
    It's a nice practice to mark threads resolved!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center