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
Sent: Friday, July 15, 2005 1:21 PM
To: [email protected]
Subject: RE: [flexcoders] onFocus, setSelection not highlighting textinput

 

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>

 

 





--
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




Reply via email to