I met a very strange problem today, it’s about the “Button” component.
Well, I put a button on the stage and use
myButton.enabled = false;
but it doesn’t go disabled.
You have to “wait for some time” to make it work, or finally, I find using an ‘ADD_TO_STAGE’ event to solve it:
// The constructor of this sprite object
public function MySprite()
{
super();
myButton.enabled = false; // NEVER work, WHY ??
this.addEventListener(EVENT.ADD_TO_STAGE, handler);
}
// a handler
function handler(){
myButton.enabled = false; // work!
}
I am not sure whether this is the only solution if I have to use components from Flash CS3 …
Anyone knows why? and is my solution a reasonable one?
Thanks in advance.