Disabling a button in AS3 (myMC.enabled in AS3)

I ran across the problem the other day of trying to disable a button without removing its MouseEvent listeners.

In AS2 you could simply disable a button by setting it’s “enabled” property to false.

AS2

myMC.enabled = false;

The new and improved way is:

AS3

myMC.mouseEnabled = false;

Note: this requires you have a button with its MouseEvent listeners already set.

This is different than AS2 in that you can actually disable all mouse events for any display object - not just buttons. So be careful what you disable!

del.icio.us Slashdot Digg Facebook Technorati Google Yahoo


About this entry