class flash.events.FocusEvent extends Event

Available on all platforms

An object dispatches a FocusEvent object when the user changes the focus * from one object in the display list to another. There are four types of * focus events: *

    *
  • FocusEvent.FOCUSIN
  • *
  • FocusEvent.FOCUSOUT
  • *
  • FocusEvent.KEYFOCUSCHANGE
  • *
  • FocusEvent.MOUSEFOCUSCHANGE
  • *

Class Fields

static var FOCUS_IN:String

Defines the value of the type property of a * focusIn event object. * *

This event has the following properties:

static var FOCUS_OUT:String

Defines the value of the type property of a * focusOut event object. * *

This event has the following properties:

static var KEY_FOCUS_CHANGE:String

Defines the value of the type property of a * keyFocusChange event object. * *

This event has the following properties:

static var MOUSE_FOCUS_CHANGE:String

Defines the value of the type property of a * mouseFocusChange event object. * *

This event has the following properties:

Instance Fields

var isRelatedObjectInaccessible:Bool

If true, the relatedObject property is set to * null for reasons related to security sandboxes. If the * nominal value of relatedObject is a reference to a * DisplayObject in another sandbox, relatedObject is set to * null unless there is permission in both directions across * this sandbox boundary. Permission is established by calling * Security.allowDomain() from a SWF file, or by providing a * policy file from the server of an image file, and setting the * LoaderContext.checkPolicyFile property when loading the * image.

var keyCode:UInt

The key code value of the key pressed to trigger a * keyFocusChange event.

var relatedObject:InteractiveObject

A reference to the complementary InteractiveObject instance that is * affected by the change in focus. For example, when a focusOut * event occurs, the relatedObject represents the * InteractiveObject instance that has gained focus. * *

The value of this property can be null in two * circumstances: if there no related object, or there is a related object, * but it is in a security sandbox to which you don't have access. Use the * isRelatedObjectInaccessible() property to determine which of * these reasons applies.

var shiftKey:Bool

Indicates whether the Shift key modifier is activated, in which case the * value is true. Otherwise, the value is false. * This property is used only if the FocusEvent is of type * keyFocusChange.

function new(type:String, ?bubbles:Bool, ?cancelable:Bool, ?relatedObject:InteractiveObject, ?shiftKey:Bool, ?keyCode:UInt):Void

Creates an Event object with specific information relevant to focus * events. Event objects are passed as parameters to event listeners. * *

type

The type of the event. Possible values are: * FocusEvent.FOCUSIN, * FocusEvent.FOCUSOUT, * FocusEvent.KEYFOCUSCHANGE, and * FocusEvent.MOUSEFOCUSCHANGE. *

bubbles

Determines whether the Event object participates in * the bubbling stage of the event flow. *

cancelable

Determines whether the Event object can be canceled. *

relatedObject

Indicates the complementary InteractiveObject instance that is affected by the change in focus. For example, when a focusIn event occurs, relatedObject represents the InteractiveObject that has lost focus. *

shiftKey

Indicates whether the Shift key modifier is * activated. *

keyCode

Indicates the code of the key pressed to trigger a * keyFocusChange event.