|
Oh…guess I didn’t read your original email closely enough…sorry…and you’re saying that you’ve also tried using something like:
this.createTextField("myText_txt", 99, 10, 10, 200, 30); myText_txt.text = "this is my text"; Selection.setFocus("myText_txt"); Selection.setSelection(0, 3);
Where you use the setSelection method to explicitly select the text in the textinput component itself?
Robert L. Brueckmann Senior Web Developer Merlin Securities, LLC 595 Madison Avenue New York, NY 10022 p: 212.822.4821 f: 212.822.4820 From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Stacy Young
Thanks Robert, problem is the focus is already on the flash movie. There’s user interaction prior to the event in question taking place. (although I gave it a shot anyway ;-) The field is receiving focus as intended, just the text contents of the textinput field is not selected as it should be.
-Stace
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Robert Brueckmann
Stacy,
I was having the same exact problem when my application loaded for the first time because I wanted the cursor to default and the caret be blinking in the username field of the login section so the user, when going to my site, didn’t have to explicitly click their mouse in the username field to login initially. No matter what I tried, it didn’t work when I was going to http://localhost:7001/myapp/Index.mxml
BUT…I found a fix that has the caret blinking in my text field EVERY time without fail, which I don’t know if it’ll help with your situation or not, but what I did was I ended up embedding my application in a JSP page…so to access my application, the user now goes to http://localhost:7001/myapp/index.jsp and in my jsp page I have _javascript_ that EXPLICITLY sets focus to the now-embedded swf file…by doing this…the browser’s focus is initially set to the flash movie (i.e.: my flex app), which in turn successfully makes use of the Selection.setFocus(username) call successfully that I have in the creationComplete listener of the username TextInput component.
My index.jsp simply looks like this:
<%@ page contentType="text/html; charset=iso-8859-1" language="java" %> <%@ taglib uri="FlexTagLib" prefix="mm" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="ROBOTS" content="NOINDEX"> <title>My App</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style></head>
<body > <mm:mxml source="Index.mxml" id="appSWF" name="appSWF" /> </body> </html>
This message contains information from Merlin Securities, LLC, or from one of its affiliates, that may be confidential and privileged. If you are not an intended recipient, please refrain from any disclosure, copying, distribution or use of this information and note that such actions are prohibited. If you have received this transmission in error, please notify the sender immediately by telephone or by replying to this transmission.
Merlin Securities, LLC is a registered broker-dealer. Services offered through Merlin Securities, LLC are not insured by the FDIC or any other Federal Government Agency, are not deposits of or guaranteed by Merlin Securities, LLC and may lose value. Nothing in this communication shall constitute a solicitation or recommendation to buy or sell a particular security.
-- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com ---- LSpots keywords ?> ---- HM ADS ?> YAHOO! GROUPS LINKS
|
- RE: [flexcoders] onFocus, setSelection not highlighting ... Robert Brueckmann

