Groups | Blog | Home
all groups > flash actionscript > august 2005 >

flash actionscript : Button steals focus even when enabled=false


abeall
8/22/2005 6:54:04 PM
If you have a button, and you set enabled=false, the button can no longer be
interacted with. However, if you have something underneath that is set to
enabled, I find that the button on top with enabled=false still blocks
interaction from occuring with anything underneath it. It appears to do the
same thing when using movieClip buttons. Is there a fix for this?
bwm_razel
8/22/2005 7:03:43 PM
Since the enabled button is under the disabled button, I'd try using the
swapDepths function, bringing the button on the bottom to the top. Try this:

if (myBtn1_btn.enabled = false) {
this.swapDepths (myBtn2_btn);
}
abeall
8/22/2005 7:17:31 PM
mandingo
8/22/2005 10:58:01 PM
if the button is disabled, it still exists to have interactions it just won't
respond to any...

if the button isn't supposed to exist at that point of the timeline, then use
_visible then whatever is underneath is fine to be interacted with.

cheers

btw, bwm_razel's if condition needs to have "==" not a single "="


abeall
8/23/2005 12:37:56 AM
That's ashame...
I was fading out the buttons anyway, so I was able to set them to
_visible=false once they were done fading, but what if that wasn't the case? Oh
well, just glad it worked this time.
AddThis Social Bookmark Button