Thanks Jesse! Appreciate it
On 7/24/06, JesterXL <[EMAIL PROTECTED]
> wrote:
Try:
inputField.setFocus();
inputField.setSelection(0, inputField.text.length);
----- Original Message -----
From: "Rick Schmitty" <[EMAIL PROTECTED]>
To: <flexcoders@yahoogroups.com>
Sent: Monday, July 24, 2006 6:04 PM
Subject: [flexcoders] stage.focus problem with input fields
I'm having display issues after using stage.focus. I have a component
that I'd like to switch from a button click to textInput as part of
the functionality. The highlighted portion of the inputText varies
based on the last 'known' (?) size. I've tried invalidating
everything I can think of but I must be missing something
If you run this example, and click the radio buttons in order you will
see that the focus box of the textInput is set to the size of the last
.text value and not its current .text value. If you go in reverse, it
appears to work but only because its going from larger to smaller :)
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
private function onClick(str:String):void {
inputField.text=str;
inputField.invalidateDisplayList();
inputField.invalidateProperties();
inputField.invalidateSize();
invalidateDisplayList();
invalidateProperties();
invalidateSize();
stage.focus=inputField;
}
]]>
</mx:Script>
<mx:TextInput id="inputField"/>
<mx:RadioButton label="A" click="onClick('A')"/>
<mx:RadioButton label="ABC" click="onClick('ABC')"/>
<mx:RadioButton label="ABCasdfasdf" click="onClick('ABCasdfasdf')"/>
</mx:Application>
Any ideas?
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
__._,_.___
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
![]()
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__,_._,___
Reply via email to