alwaysEnableArrowKeys static property
alwaysEnableArrowKeys:Boolean [read-write]
Scaleform version: 4.0.12
This static property allows arrow keys to change focus even when the _focusrect property is set to false (applied when the focus is captured). By default, Flash does not allow you to use arrow keys to change focus if the yellow focus rectangle is disabled via _focusrect = false. To change this behavior, set the alwaysEnableArrowKeys property to true.
disableFocusKeys static property
disableFocusKeys:Boolean [read-write]
Scaleform version: 4.0.12
This static property disables handling of all focus keys (TAB, Shift-TAB and arrow keys), thus, users may implement their own focus keys management.
moveFocus() static method
static public function moveFocus(keyToSimulate : String, startFromMovie:InteractiveObject = null, includeFocusEnabledChars : Boolean = false, controllerIdx : uint = 0) : InteractiveObject
Scaleform version: 4.0.12
This static method is used to move a focus rectangle by simulating key pressing of one of focus keys: TAB, Shift-TAB or arrow keys. This method with cooperation of disableFocusKeys and modalClip properties may be used for implementing custom focus management.
Parameters keyToSimulate : String - Name of key to simulate: “up”, “down”, “left”, “right”, “tab”, “shifttab”. startFromMovie:InteractiveObject – Optional parameter that specifies a character; moveFocus will use it instead of the currently focused one as a start point. This property might be null or undefined, which means that currently focused character is used as a starting point; this might be useful to specify the third optional parameter.
includeFocusEnabledChars : Boolean – Optional flag that allows moveFocus onto characters with only the focusEnabled property set as well as onto characters with the tabEnabled / tabIndex properties set. If the flag is not specified or set to false then only characters with the tabEnabled / tabIndex properties set will participate in focus movement.
controllerIdx : uint - Index of the controller used for the operation. If not specified, then the default controller (controller 0) is used.
Returns
Returns next character to be focused or null if the character cannot be found.
See also:
findFocus disableFocusKeys setModalClip getModalClip
findFocus() static method
static public function findFocus(keyToSimulate : String, parentMovie:DisplayObjectContainer = null, loop : Boolean = false, startFromMovie:InteractiveObject = null, includeFocusEnabledChars : Boolean = false, controllerIdx : uint = 0) : InteractiveObject
Scaleform version: 4.0.12
This static method is used to find the next focus item by simulating key pressing of one of the following keys: TAB, Shift-TAB or arrow keys. This method with conjunction with the disableFocusKeys and setModalClip/getModalClip extensions may be used to implement custom focus management.
Parameters
keyToSimulate : String - Name of key to simulate: “up”, “down”, “left”, “right”, “tab”, “shifttab”.
parentMovie:DisplayObjectContainer – The movie clip that is used as a modal clip. The focus item search is performed only within this clip’s children. May be null.
loop : Boolean - Boolean flag to loop focus. For example, if the currently focused item is at the bottom and the key is “down”, then findFocus either returns “null” (if this flag is “false”) or the topmost focusable item (if the flag is “true”).
startFromMovie:InteractiveObject – Optional parameter that specifies a character that findFocus will use instead of the currently focused one as a start point. This property might be null or undefined, which means that the currently focused character is used as a starting point.
includeFocusEnabledChars : Boolean – Optional flag that allows moveFocus onto characters with only the focusEnabled property set as well as onto characters with the tabEnabled / tabIndex properties set. If the flag is not specified or set to false then only characters with the tabEnabled / tabIndex properties set will participate in focus movement.
controllerIdx : uint - A zero base index of the controller that is manipulating focus. This in conjunction with focus groups can be used to provide multi controller focus support.
Returns
Returns next character to be focused or null if the character cannot be found.
See also:
moveFocus disableFocusKeys setModalClip getModalClip
setFocus() static method
static public function setFocus(obj:InteractiveObject, controllerIdx:uint = 0) : void
Scaleform version: 4.0.12
This static method does the same as assigning stage.focus property. The only difference is that it is possible to specify the index of the controller that should be associated with the operation.
Parameters
obj:InteractiveObject - Newly focused interactive object controllerIdx : uint - Indicates which keyboard/controller is used for the event (zero-based index).
getFocus() static method
static public function getFocus(controllerIdx:uint = 0) : InteractiveObject
Scaleform version: 4.0.12
This static method returns the same value as the stage.focus property. The only difference is that it is possible to specify the index of the controller that should be associated with the operation.
Parameters
controllerIdx : uint - Indicates which keyboard/controller is used for the event (zero-based index).
Returns Currently focused interactive object.
numFocusGroups static property
numFocusGroups() : uint [read]
Scaleform version: 4.0.12
Returns the number of focus groups, set up by call to setControllerFocusGroupfunction. If focus groups 0 and 3 are active, numFocusGroups will return 2.
setFocusGroupMask() static method
public function setFocusGroupMask(obj:InteractiveObject, mask:uint) : void
Scaleform version: 4.0.12
This method sets a bitmask to a character and ALL of its children. This bitmask assigns focus group ownership to the character, meaning only the controllers denoted in the bitmask are able to move focus into and within the character. Focus groups can be associated with controllers by using setControllerFocusGroup extension method.
For example, let’s assume that “button1” is to be focusable only by controller 0 and “movieclip2” by controllers 0 and 1. To achieve this behavior, associate focus groups with the controllers:
FocusManager.setControllerFocusGroup(0, 0); FocusManager.setControllerFocusGroup(1, 1); FocusManager.setFocusGroupMask(button1, 0x1); // bit 0 – focus group 0 FocusManager.setFocusGroupMask(movieclip2,0x1 | 0x2); // bits 0 and 1 – focus groups 0 and 1
The “focusGroupMask” bitmask may be set to the parent movieclip. This will propogate the mask value to all of its children.
Parameters
obj:InteractiveObject - An interactive object mask:uint - A focus group bitmask
See also:
setControllerFocusGroup getFocusGroupMask
getFocusGroupMask() static method
static public function getFocusGroupMask(obj:InteractiveObject) : uint
Scaleform version: 4.0.12
Returns current focus group bitmask value (see setFocusGroupMask for details).
Parameters
obj:InteractiveObject - An interactive object
Returns A focus group bitmask for the specified interactive object.
See also:
setControllerFocusGroup setFocusGroupMask
setControllerFocusGroup() static method
static public function setControllerFocusGroup(controllerIdx:uint, focusGroupIdx:uint) : Boolean
Scaleform version: 4.0.12
This static method associates the controller denoted by controllerIndex with a focus group. By default, all controllers are associated with focus group 0, which means that they are using the same focus. However, it is possible to make each controller work with their own focus. For example, if two controllers should have separate focus (in a split-screen use case) then setControllerFocusGroup(1,1) will create a separate focus group for the controller 1. Calling setControllerFocusGroup(1,0) will make controller 0 and 1 to share the same focus again.
Parameters
controllerIdx:uint - Zero-base index of the controller. focusGroupIdx:uint - Zero-base index of the focus group.
Returns
Returns true if successful.
getControllerFocusGroup() static method
static public function getControllerFocusGroup(controllerIdx:uint) : uint
Scaleform version: 4.0.12
This static method returns the focus group index associated with the specified controller.
Parameters
controllerIndex – Zero-base index of the physical controller.
Returns
Zero-based index of focus group.
setModalClip() static method
static public function setModalClip(mc:Sprite, controllerIdx:uint = 0) : void
Scaleform version: 4.0.12
This static method sets the specified movie clip as a “modal” clip for focus management. This means TAB, Shift-TAB and arrow keys will move focus only inside the specified movie clip across all “tabable” children.
Parameters
controllerIdx:uint - A zero base index of the controller. mc:Sprite - A modal clip.
getModalClip() static method
static public function getModalClip(controllerIdx:uint = 0) : Sprite
Scaleform version: 4.0.12
This static method returns the modal clip for the specified controller.
Parameters
controllerIdx - Zero base index of the controller.
Returns A modal clip or undefined if not found.
getControllerMaskByFocusGroup () static method
public function getControllerMaskByFocusGroup(focusGroupIdx:uint) : uint
Scaleform version: 4.0.17
This static method returns a bitmask where each bit represents a controller that is associated with the specified focus group. Returns the state set by the setControllerFocusGroup function.
Parameters
focusGroupIdx - An index of focus group.
Returns A bitmask of controllers.