Archive for August 20th, 2008

20
Aug

Determining if an item is listening for a specific event

The following example shows how you can check whether a Flex Button control is listening for a specific event (FlexEvent.BUTTON_DOWN) by using the hasEventListener() and willTrigger() methods.

According to the Flex 3 documentation for the EventDispatcher class’s hasEventListener() method (link):

The difference between hasEventListener() and willTrigger() is that hasEventListener() examines only the object to which it belongs, whereas willTrigger() examines the entire event flow for the event specified by the type parameter.

Full code after the jump.

Continue reading ‘Determining if an item is listening for a specific event’

20
Aug

Changing the default skins on a Button control in Flex

The following example shows how you can modify the default skins for the Flex Button control by setting the skin, upSkin, overSkin, downSkin, and disabledSkin styles.

Full code after the jump.

Continue reading ‘Changing the default skins on a Button control in Flex’