
Button.onDragOut() Event Handler
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
464
|
ActionScript Language Reference
// Assign button handlers
ok_btn.onRelease = doAction;
cancel_btn.onRelease = doAction;
Or, if we’re looking for a single button in a group of unknown buttons, we can use a for-in
loop to hunt for the button’s instance name:
// Access all properties of someClip
for (var p in someClip) {
// If it's a Button object...
if (someClip[p] instanceof Button) {
// ...show its name:
trace("Found " + someClip[p]._name);
// Look for edit_btn
if (someClip[p]._name = = "edit_btn") {
// Disable the edit button.
someClip[p].enabled = false;
}
}
}
See Also
Button.onRelease(), “The for-in Loop,” in Chapter 8
Button.onDragOut() Event Handler
occurs when the depressed mouse is rolled off a Flash button
Flash 6; on (dragOut) supported since Flash 2
theButton.onDragOut()
on (dragOut) {
statements
}
Description
The onDragOut() event handler executes when the primary mouse button is depressed
while the mouse pointer is in
theButton’s hit area, and then, while the mouse button is still
depressed, the pointer is moved out of the hit area. It is similar to onRollOut(), except that
it is generated only if the mouse button is down when the pointer leaves a button’s hit area.
The onDragOut() event is followed by either the onReleaseOutside() event (if