ButtonEventHandler Documentation
Author: Trevor McCauley
Last Modified: 4/05/08 3:16:02
Summary
ButtonEventHandler class:
ButtonEventHandler Properties:
ButtonEventHandler Methods:
version: 0.9.7
description:
The ButtonEventHandler class allows for timeline-based instances (MovieClips) to receive button events and allows for those events to bubble up to parent clips. This is contrary to normal button event behavior (Buttons and MovieClips) which starts at the parent clip, or the first parent clip with any kind of button event assigned to it, and prevents any child clips from receiving any button events at all. A list of all supported events are as follows:
ButtonEventHandler Properties:
Determines whether or not arrangement for handled movie clips is automatically updated every frame. If depths are altered for movie clips receiving events, this should be kept false.
Determines whether or not overlapping prevents events for objects in the same timeline (no parent/child relationships) from triggering. If true, the behavior is like that of normal Flash buttons where buttons above other buttons, prevent the buttons below from receiving events.
initialize
description: Initializes a target timeline instance (MovieClip) to be registered for receiving events from the ButtonEventHandler class. When initialized, the target as well as all its parents are initialized too, if not already. The returned ButtonEvent object can be used to handle received events.
usage:
event:ButtonEvent = ButtonEventHandler.initialize(target:MovieClip);
parameters:
returns: ButtonEvent object associated with the target movie clip passed. This is the same object sent to event handlers when they are called.
uninitialize
description: Removes the target movie clip from initialization preventing from receiving further events from ButtonEventHandler. Any child movie clips are removed along with target.
usage:
success:Boolean = ButtonEventHandler.initialize(target:MovieClip);
parameters:
returns: True or false depending on whether or not the removal was successful.
getEventObject
description: Returns an event object associated with the target movie clip. If no ButtonEvent is associated with the target, the target will be initialized and a new ButtonEvent object will be created and returned.
usage:
event:ButtonEvent = ButtonEventHandler.getEventObject(movie:MovieClip);
parameters:
returns: ButtonEvent object associated with the target movie clip passed. This is the same object sent to event handlers when they are called.
updateArrangement
description: Updates the arrangement and precedence of movie clips handled by ButtonEventHandler. This will automatically be called every frame if autoUpdateArrangement is true. You would only need to call this if autoUpdateArrangement is false and you've altered the depths of any movie clips receiving events from ButtonEventHandler.
usage:
ButtonEventHandler.updateArrangement();
parameters:
returns: No return specified