Main Page | Packages | Class Tree | Index | Help

mx.managers

class FocusManager

Object
  |
  +--MovieClip
        |
        +--mx.core.UIObject
              |
              +--mx.core.UIComponent
                    |
                    +--mx.managers.FocusManager


class FocusManager
extends UIComponent

Class for managing the focus on components.

Each top-level window has a focus manager.



Field Summary


__defaultPushButton: SimpleButton
pointer to the original defaultPushButton.


bDrawFocus: Boolean
true if we should call drawFocus on the components.


bNeedFocus: Boolean
true if no component has the focus


className: String
name of this class


defaultPushButtonEnabled: Boolean
TextArea and other components that want the enter key disable the focus manager's enter key handling


defPushButton: SimpleButton
the current default pushbutton


form
the top-level form that this focus manager is responsible for


lastFocus: Object
the object that last had focus


lastMouse: Object
last mouse position


lastSelFocus: Object
the last object according to Selection


lastTabFocus: Object
the object that was last tabbed to

static
symbolName: String


static
symbolOwner: Object


static
version: String
Version string Copyright (C) 2003 Macromedia, Inc.

Fields inherited from class mx.core.UIComponent

clipParameters, drawFocus, enabled, focusEnabled, focusManager, focusTextField, groupName, kStretch, mergedClipParameters, origBorderStyles, origBorderValues, popUp, symbolName, symbolOwner, tabEnabled, tabIndex, version

Fields inherited from class mx.core.UIObject

__height, __width, _color, _topmost, addEventListener, buildDepthTable, changeColorStyleInChildren, changeTextStyleInChildren, childrenCreated, className, clipParameters, color, createAccessibilityImplementation, createChildAtDepth, createEvent, ction, dispatchEvent, embedFonts, findNextAvailableDepth, fontFamily, fontSize, fontStyle, fontWeight, handleEvent, idNames, ignoreClassStyleDeclaration, initProperties, marginLeft, marginRight, methodTable, notifyStyleChangeInChildren, removeEventListener, setStyle, stylecache, styleName, symbolName, symbolOwner, textAlign, textColorList, textDecoration, textIndent, validateNow, version

Fields inherited from class MovieClip

_alpha, _currentframe, _droptarget, _focusrect, _framesloaded, _height, _lockroot, _name, _parent, _quality, _rotation, _soundbuftime, _target, _totalframes, _url, _visible, _width, _x, _xmouse, _xscale, _y, _ymouse, _yscale, enabled, focusEnabled, hitArea, tabChildren, tabEnabled, tabIndex, tooltipText, trackAsMenu, useHandCursor

Fields inherited from class Object

__proto__, constructor, prototype

Property Summary


defaultPushButton: SimpleButton (read, write)
get or set the original default pushbutton.


nextTabIndex: Number (read-only)
get the next unique tab index to use on this form

Properties inherited from class mx.core.UIComponent

height, width

Properties inherited from class mx.core.UIObject

bottom, height, left, minHeight, minWidth, right, scaleX, scaleY, top, visible, width, x, y

Constructor


FocusManager ( )


Method Summary


activate ( Void ): Void
the SystemManager manages activation of forms if more than one is visible at the same time


deactivate ( Void ): Void
the SystemManager manages activation of forms if more than one is visible at the same time


enabledChanged ( id: String, oldValue: Boolean, newValue: Boolean ): Boolean
a FocusManager has an internal tabKey capture mechanism that is enabled by setting its TabIndex to undefined or not


getActualFocus ( o: Object ): Object
a component may set focus to an internal object that doesn't have tabIndex, etc.


getFocus ( Void ): Object
get the component that current has the focus.


getMaxTabIndex ( o: UIComponent ): Number
get the highest tab index currently used in this focus manager's form or subform


getNextTabIndex ( Void ): Number
internal overridable calculation of the next tab index to use


getSelectionFocus ( ): Object



init ( Void ): Void
initialize variables and make sure we aren't also a tabstop


isOurFocus ( o: Object ): Boolean



onSetFocus ( o: Object, n: Object ): Void
if you were in a textfield and clicked somewhere other than a textfield, the player sets focus automatically to null.


onUnload ( Void ): Void
tell the system manager that we're going bye-bye


relocate ( Void ): Void
the focus manager stays off screen.


restoreFocus ( Void ): Void
not only do we restore focus back to the last thing that had it but if it is a textfield, we also restore the selection


setFocus ( o: Object ): Void
set the focus to an object.


walkTree ( p: MovieClip, index: Number, groupName: String, dir: Boolean, lookup: Boolean, firstChild: Boolean ): Void
instead of caching and updating the tab list, we simply scan for them on each Tab key.

Methods inherited from class mx.core.UIComponent

dispatchValueChangedEvent, enabledChanged, findFocusFromObject, findFocusInChildren, getFocus, getFocusManager, init, isParent, onKillFocus, onSetFocus, pressFocus, releaseFocus, setEnabled, setFocus, setVisible, size

Methods inherited from class mx.core.UIObject

__getTextFormat, _createChildren, _getTextFormat, cancelAllDoLaters, constructObject, createChildren, createClassObject, createEmptyObject, createLabel, createObject, createSkin, destroyObject, doLater, doLaterDispatcher, draw, drawRect, getClassStyleDeclaration, getMinHeight, getMinWidth, getSkinIDName, getStyle, getStyleName, init, initFromClipParameters, invalidate, invalidateStyle, mergeClipParameters, move, redraw, setColor, setMinHeight, setMinWidth, setSize, setSkin, setVisible, size

Methods inherited from class MovieClip

attachAudio, attachMovie, beginFill, beginGradientFill, clear, createEmptyMovieClip, createTextField, curveTo, duplicateMovieClip, endFill, getBounds, getBytesLoaded, getBytesTotal, getDepth, getInstanceAtDepth, getNextHighestDepth, getSWFVersion, getTextSnapshot, getURL, globalToLocal, gotoAndPlay, gotoAndStop, hitTest, lineStyle, lineTo, loadMovie, loadVariables, localToGlobal, moveTo, nextFrame, onData, onDragOut, onDragOver, onEnterFrame, onKeyDown, onKeyUp, onKillFocus, onLoad, onMouseDown, onMouseMove, onMouseUp, onPress, onRelease, onReleaseOutside, onRollOut, onRollOver, onSetFocus, onUnload, play, prevFrame, removeMovieClip, setMask, startDrag, stop, stopDrag, swapDepths, unloadMovie, valueOf

Methods inherited from class Object

addProperty, hasOwnProperty, isPropertyEnumerable, isPrototypeOf, registerClass, toLocaleString, toString, unwatch, valueOf, watch



Field Documentation

__defaultPushButton

var __defaultPushButton: SimpleButton
pointer to the original defaultPushButton.

The actual default pushbutton changes if focus is given to another pushbutton, but switches back to the original if focus is not on a button

bDrawFocus

var bDrawFocus: Boolean
true if we should call drawFocus on the components.

when tabbing, this is true, when mousing, this is false

bNeedFocus

var bNeedFocus: Boolean
true if no component has the focus

className

var className: String
name of this class

defaultPushButtonEnabled

var defaultPushButtonEnabled: Boolean
TextArea and other components that want the enter key disable the focus manager's enter key handling

defPushButton

var defPushButton: SimpleButton
the current default pushbutton

form

var form
the top-level form that this focus manager is responsible for

lastFocus

var lastFocus: Object
the object that last had focus

lastMouse

var lastMouse: Object
last mouse position

lastSelFocus

var lastSelFocus: Object
the last object according to Selection

lastTabFocus

var lastTabFocus: Object
the object that was last tabbed to

symbolName

static var symbolName: String

symbolOwner

static var symbolOwner: Object

version

static var version: String
Version string Copyright (C) 2003 Macromedia, Inc.

All Rights Reserved. The following is Sample Code and is subject to all restrictions on such code as contained in the End User License Agreement accompanying this product.


Property Documentation

defaultPushButton

defaultPushButton: SimpleButton (read, write)
get or set the original default pushbutton.

This may not be the actual button that is the default

nextTabIndex

nextTabIndex: Number (read-only)
get the next unique tab index to use on this form


Constructor Documentation

FocusManager

function FocusManager()

Method Documentation

activate

function activate(Void): Void
the SystemManager manages activation of forms if more than one is visible at the same time

deactivate

function deactivate(Void): Void
the SystemManager manages activation of forms if more than one is visible at the same time

enabledChanged

function enabledChanged(id: String,
 oldValue: Boolean,
 newValue: Boolean): Boolean
a FocusManager has an internal tabKey capture mechanism that is enabled by setting its TabIndex to undefined or not

Overrides:

getActualFocus

function getActualFocus(o: Object): Object
a component may set focus to an internal object that doesn't have tabIndex, etc.

We need to find out what component owns this internal object

getFocus

function getFocus(Void): Object
get the component that current has the focus.

Recommended instead of using Selection object because it will tell you which component. Selection might return a subobject in that component

Overrides:

Returns:
the object that has focus

getMaxTabIndex

function getMaxTabIndex(o: UIComponent): Number
get the highest tab index currently used in this focus manager's form or subform

Parameters:
o
the form or subform
Returns:
Number the highest tab index currently used

getNextTabIndex

function getNextTabIndex(Void): Number
internal overridable calculation of the next tab index to use

getSelectionFocus

function getSelectionFocus(): Object

init

function init(Void): Void
initialize variables and make sure we aren't also a tabstop

Overrides:

isOurFocus

function isOurFocus(o: Object): Boolean

onSetFocus

function onSetFocus(o: Object,
 n: Object): Void
if you were in a textfield and clicked somewhere other than a textfield, the player sets focus automatically to null.

we take note of this and if focus doesn't end up in a movieclip, we set focus back to the textfield.

Overrides:

onUnload

function onUnload(Void): Void
tell the system manager that we're going bye-bye

Overrides:

relocate

function relocate(Void): Void
the focus manager stays off screen.

If the stage resizes, the focus manager must move as well

restoreFocus

function restoreFocus(Void): Void
not only do we restore focus back to the last thing that had it but if it is a textfield, we also restore the selection

setFocus

function setFocus(o: Object): Void
set the focus to an object.

Recommended instead of using Selection object

Overrides:

Parameters:
o
the object to receive focus

walkTree

function walkTree(p: MovieClip,
 index: Number,
 groupName: String,
 dir: Boolean,
 lookup: Boolean,
 firstChild: Boolean): Void
instead of caching and updating the tab list, we simply scan for them on each Tab key.

There seems to be enough time to run this calculation

Parameters:
p
the node in the tree to search
index
the tabindex of the last focused item in case there's another item with the same tabindex
groupName
groupname of the last focused item so we won't tab to other things in that group
dir
true if Tab, false if shift-Tab
lookup
true if we're not at the top level and need to search the parents as well
firstChild
true if we haven't found the first child yet

The documentation was generated from the following file:


Copyright © 1997-2005 Macromedia, Inc. All rights reserved. Generated with AS2Doc