At work we use a lot of fake pop-ups in Flash to show information. Everything generally works very well, until we discovered that you can click buttons in flash that are underneath a movieclip or a graphic.
The first solution was to hard code disabling of MovieClips/buttons like so:
button1_btn.onPress = function(){ popUp_mc._visible = true; button1._btn.enabled = false; button2._btn.enabled = false; } popUpClose_btn.onPress = function(){ popUp_mc._visible = false; button1._btn.enabled = true; button2._btn.enabled = true; }
As you can see, this is VERY messy and impractical, as every time you add another button, you have to edit the code for the pop-up buttons to enable/disable it when shown.
One thing we did know up front is that if you put two buttons on top of one another, the one with the highest depth will over take the one below it. Therefore only the top one get's clicked. (The same is not true for rollovers, both items recieve a rollover event, but not click.)
So, we tried using a giant button below the background of the fake pop-up movieclip. It worked in the fact that we could not click buttons below the MovieClip. What was not cool was the hand cursor that showed up over the entire MovieClip because we had a button in the background. Fortunatly, we discovered a built in ActionScript function that disables the hand cursor:
hiddenButton_btn.useHandCursor = false;
It solved our problem completely! Now we could have pop-ups and not be able to click buttons underneath them while they were open.




Page 1 of 1 pages
Previous entry: Using The Tag Limit Plug-in with ExpressionEngine | Next entry: Playing Flash FLVs without the Flash Player