• Sep


    A text field's default text format is not static—it dynamically adjusts itself to match the formatting of text at the insertion point (also known as the caret position). Accordingly, when the user inputs new text after a given character in a text field, that character's format determines the format of the new text. Likewise, when replaceText() is used to add new text to a text field, the new text takes on the formatting of the either the character following the new text (if any existing text was deleted), or the character preceding the new text (if no existing text was deleted).





    The general process for responding to an event in ActionScript 3.0 is as follows:

    1. Determine the name of the event's event-type.
    2. Determine the datatype of the event object representing the event.
    3. Create an event listener to respond to the event. The event listener must define a single parameter matching the datatype of the event object from Step 2.
    4. Use EventDispatcher class's instance method addEventListener() to register the event listener with the event target (or, any display ancestor of the event target).
    5. Sit back and wait for the event to occur.