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:
This is the code that accesses it ("my_FLVPlybk" being the instance of your FLVPlayback component)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); } } }
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?




Reply With Quote