
MovieClip.focusEnabled Property
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Alphabetical Language Reference
|
653
_root.lineTo(225,200);
_root.endFill();
See Also
MovieClip.beginFill(), MovieClip.beginGradientFill(), MovieClip.clear(), MovieClip.curveTo(),
MovieClip.lineStyle(), MovieClip.lineTo(), MovieClip.moveTo()
MovieClip.focusEnabled Property
allow the clip to be focused programmatically
Flash 6
read/write
mc.focusEnabled
Description
When the Boolean focusEnabled property is false or undefined (the default) and mc defines
no button handlers (onPress(), onRelease(), etc.),
mc cannot be focused via Selection.
setFocus(). When
focusEnabled is true, mc can be focused via Selection.setFocus() at any
time, even when no button handlers are defined. When
mc defines at least one button
handler, it can still be focused via Selection.setFocus(), even when
focusEnabled is false.To
disable focus for a movie clip with button handlers, remove the handlers and set
focusEnabled to false. For example, the following code removes the onPress() handler of
theClip_mc:
delete theClip_mc.onPress;
We use focusEnabled when creating movie clips that act as keyboard-controlled interface
elements, such as a modal dialog box with Yes and No buttons activated by the keys “Y”
and “N.” The dialog box should respond to “Y” and “N” only when it has focus. The
following ...