Adobe® Flex® 4 Language Reference
Hide Packages and Classes List |  Packages  |  Classes  |  Index  |  Appendixes
mx.automation.delegates 
TextFieldAutomationHelper 
Packagemx.automation.delegates
Classpublic class TextFieldAutomationHelper
InheritanceTextFieldAutomationHelper Inheritance Object

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Utility class that facilitates replay of text input and selection.



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Public Methods
 MethodDefined By
  
Constructor.
TextFieldAutomationHelper
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
recordAutomatableEvent(interaction:Event, cacheable:Boolean = false):void
Records the user interaction with the text control.
TextFieldAutomationHelper
  
Replays TypeTextEvents and TypeEvents.
TextFieldAutomationHelper
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Constructor Detail

TextFieldAutomationHelper

()Constructor
public function TextFieldAutomationHelper(owner:IEventDispatcher, replayer:IAutomationObject, textField:mx.core:IUITextField)

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Constructor.

Parameters
owner:IEventDispatcher — The UIComponent that is using the TextField. For example, if a TextArea is using the TextField, then the TextArea is the owner.
 
replayer:IAutomationObject — The IAutomationObject of the component.
 
textField:mx.core:IUITextField — The TextField object inside the component.
Method Detail

recordAutomatableEvent

()method
public function recordAutomatableEvent(interaction:Event, cacheable:Boolean = false):void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Records the user interaction with the text control.

Parameters

interaction:Event — The event to record.
 
cacheable:Boolean (default = false) — Contains true if this is a cacheable event, and false if not.

replayAutomatableEvent

()method 
public function replayAutomatableEvent(event:Event):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Replays TypeTextEvents and TypeEvents. TypeTextEvents are replayed by calling replaceText on the underlying text field. TypeEvents are replayed depending on the character typed. Both also dispatch the origin keystrokes. This is necessary to mimic the original behavior, in case any components are listening to keystroke events (for example, DataGrid listens to itemRenderer events, or if a custom component is trying to do key masking). Ideally, the code would just dispatch the original keystrokes, but the Flash Player TextField ignores the events we are sending it.

Parameters

event:Event — Event to replay.

Returns
Boolean — If true, replay the event.