A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Disable video controls with AS

  1. #1
    Member
    Join Date
    Sep 2001
    Posts
    69

    Disable video controls with AS

    Hello all,

    Quick question... It is possible with AS to disable the video controls on the FLV player component that comes standard with Flash?

    I'm having an issue with the video playing when a user clicks on a MC that is laying over the video and obscuring it. I've tried a few things like ._visible with no luck.

    Thanks!
    jessicuh

  2. #2

    disable and dim video controls with AS2?

    I'm trying to do the same thing, but also force the buttons into their dimmed out / disabled state. I found the following, which does work in disabling the button functionality (I added stuff to try to get rid of the hand cursor on rollover), but they don't seem to want to be dimmed, which is odd. Because my trace statements are telling me this:

    disabling buttons
    _level0.my_FLVPlybk.skin_mc.back_mc
    _level0.my_FLVPlybk.skin_mc.back_mc.disabled_mc

    This is the code that does the work:

    Code:
    mx.video.FLVPlayback.prototype.enableButtons = function(bEnabled:Boolean) {
    	this.skin_mc.seekBar_mc.handle_mc._visible = bEnabled;
    	this.skin_mc.seekBar_mc.volumeBarHandle_mc._visible = bEnabled;
    	if (bEnabled) {
    		
    		// note: emulate method below to enable buttons once it's working
    		this.playButton = this.skin_mc.layout_mc.play_mc;
    		this.stopButton = this.skin_mc.layout_mc.stop_mc;
    		this.backButton = this.skin_mc.layout_mc.back_mc;
    		this.forwardButton = this.skin_mc.layout_mc.forward_mc;
    		this.seekBar = this.skin_mc.seekBar_mc;
    		this.muteButton = this.skin_mc.layout_mc.volumeMute_mc;
    	} else {
    		trace("disabling buttons");
    		this.onEnterFrame = function() {
    			
    			trace(this.backButton);
    			
    			// change visual button images (also kills functionality but not hand on rollover)
    
    			this.playButton = this.skin_mc.play_mc.disabled_mc;
    			this.stopButton = this.skin_mc.stop_mc.disabled_mc;
    			this.backButton = this.skin_mc.back_mc.disabled_mc;
    			this.forwardButton = this.skin_mc.forward_mc.disabled_mc;
    			this.muteButton = this.skin_mc.volumeMute_mc.disabled_mc;
    			this.seekBar = null;
    			this.volumeBar = null;
    			
    			// disable hand cursor on roll over
    			this.playButton.enabled = false;
    			this.stopButton.enabled = false;
    			this.backButton.enabled = false;
    			this.forwardButton.enabled = false;
    			this.muteButton.enabled = false; // DOESN'T WORK
    			this.seekBar.enabled = false; // NOT NEEDED?
    			this.volumeBar.enabled = false; // DOESN'T WORK
    			
    			updateAfterEvent();
    			delete this.onEnterFrame;
    			
    			trace(this.backButton);
    		}
    	}
    }
    This is the code that accesses it ("my_FLVPlybk" being the instance of your FLVPlayback component)

    Code:
    my_FLVPlybk.enableButtons(false);

    I also found mention of hooking into a UI Manager like so, but this didn't work for me either.

    Code:
    my_FLVPlybk._uiMgr._controlsEnabled = false;

    I'd like to get this working the right way, but I'm about to just say heck with it and put a white button with 50% opacity over all the controls to dim them all at once.

    Anybody have any insight on this? Is there a simple way of doing this?

  3. #3
    In the end I figured it was just too much trouble to do it "right" and used a blocker button. So for those looking for that quick hack, just put a button with 50% opacity over the video player buttons and use this code. How's that for simple?

    Code:
    blockerButton.onRollOver = function() {
    	this.useHandCursor = false; 
    }

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