Monday, 12 November 2007

Using Invisible Button instead of Enable

Sometimes designers make their best programming.

Problem: In an application I had lots of buttons and forms. If the user pressed the button A, every element of the stage would be disabled cos a flying window will be shown.
The first solution I had was making a function disableStage() so as to disable every forms and buttons on the Stage. The problem was that I had many Forms in different classes (lots of lines of code).

So I designed and invisible button, gave it _alpha=0, visible=true, and useHandCursor=false, adjusted its depth and problem was solved. I put this button just in the layer down button A.

Instead of many lines of code disabling things, my button allowed me to enable or disable Stage with functions enableStage() and disableStage().
Post a Comment