Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5972073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:36:24+00:00 2026-05-22T20:36:24+00:00

I am using Flex 4, ActionScript 3. In the AdvancedDataGrid component, when you are

  • 0

I am using Flex 4, ActionScript 3.

In the AdvancedDataGrid component, when you are in Edit mode in a cell, you can hit the Escape key to cancel editing (i.e. return to the previous value in the cell).

I had expected the same behaviour while in Edit mode in both the Halo and Spark TextInput and TextArea components, and was surprised to find out that this is not the case.

I looked at the attributes of all four components to see if this is something that I need to configure, but couldn’t find anything.

Is this something that needs to be coded?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:36:25+00:00Added an answer on May 22, 2026 at 8:36 pm

    Yes, this is something that will have to be coded. Here’s the approach I would take:

    1. Create a custom component that extends the TextInput. Let’s call it UndoTextInput.
    2. Add a new variable to UndoTextInput to store the original text of the TextInput. We’ll call it originalText.
    3. Add an event listener on the focusIn event. In the focusIn event handler, store the current text value in the originalText variable.
    4. Add an event on the focusOut event. In the focusOut event, set the value of originalText back to an empty String.
    5. Add an event listener on the keyDown event. In the event listener, check to see if the Escape (Keyboard.ESCAPE) key was pressed. If it was, reset the text back to what was stored in originalText.

    I hope this helps!

    UPDATE:

    Here’s a quick example on how to do this using an Actionscript class. Feel free to modify as needed.

    package
    {
        import flash.events.FocusEvent;
        import flash.events.KeyboardEvent;
        import flash.ui.Keyboard;
    
        import spark.components.TextInput;
    
        public class UndoTextInput extends TextInput
        {
            private var originalText:String = "";
    
            public function UndoTextInput()
            {
                super();
                this.addEventListener(FocusEvent.FOCUS_IN, focusInEventHandler);
                this.addEventListener(FocusEvent.FOCUS_OUT, focusOutEventHandler);
                this.addEventListener(KeyboardEvent.KEY_DOWN, checkKeyPress);
            }
    
            protected function focusOutEventHandler(event:FocusEvent):void
            {
                this.originalText = "";
            }
    
            protected function focusInEventHandler(event:FocusEvent):void
            {
                this.originalText = this.text;
            }
    
            protected function checkKeyPress(event:KeyboardEvent):void
            {
                if (event.keyCode == Keyboard.ESCAPE)
                {
                    event.stopImmediatePropagation();
                    this.text = this.originalText;
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the flex SDK to compile actionscript 3 classes into an swf.
I am trying to parse JSON in an Adobe Flex app, using http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscript-3/'>This Tutorial
I have some experience of developing in Flex/Actionscript using Cairngorm framework. At that time
I recently started using Mac OS X for a flex/actionscript project and having a
I have a pure ActionScript project. I'm using Flex Builder on a Mac, Flex
Question. How can i get started with flash/flex or actionscript, to use the Skype4Com,
I am using Flex Builder for an Actionscript which apparently has a dependency on
Using Flex Builder : I have created a new Actionscript Project. I want to
I'm new to Actionscript. I'm developing a flex mobile project using the wikipedia api
i am working with actionscript flex and using UIcomponents i need all the valid

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.