Skip navigation
Currently Being Moderated

Auto focus textinput...

Jul 3, 2013 10:34 PM

Tags: #textinput #autofocus

Before I ask something, sorry for my no good english.

 

I have made a game editor with Air sdk and flex components.

Today I got a complaint from the designer who using the game editor which I've given.

The Game editor consist main Window and sub mx::TitleWindow

and the sub titlewindow have two mx:NumericStepper.

The problem is when focus in the sub titlewindow, the NumericStepper always focus In.(the cursor wrapped the value text in editable)

 

The graphic designer want to control other component in the sub titlewindow with keyboard Input, but as always focus-in at first for NumericStepper, always need to click other componentto remove the focus of the NumericStepper...

 

So, I try to stage.focus set null when the sub Titlewindow focus-in.. but It doesn't work like what I need.

The best result what I want  is Do not auto focus the textInput when the parent of it is focus-in.

(Actually the textInput always focus-in If it have been set focus-in ever before)

 

I really want to give me a good solution or comment...

 

Thank you to read my bad English question.

 
Replies
  • Currently Being Moderated
    Jul 3, 2013 11:07 PM   in reply to crozyo

    In Flex, containers like TitleWindow do not get focus, only controls like NumericStepper.

     

    By default, no Flex SDK code should be setting focus to the NumericStepper, so it seems like some code in your app may be doing it.

     

    If you can post a small complete test case, we can try to help.

     

    -Alex

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 4, 2013 6:19 AM   in reply to crozyo

    Try to set the focusEnabled property to false.

     

    myStepper1.height = 30;

    myStepper1.focusEnabled = false;

        defaultBox.addElement(myStepper1);

     

    This will only focus the stepper when user will enter the value in it and not on any other events.

     

    Hope this will help you. 

     

    Thanks and Best regards,

    ---------------------------------------------------------------------- -----------------

    Pooja Kuber | pkuber@infocepts.com | www.infocepts.com

    ---------------------------------------------------------------------- -----------------

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points