In my template I put this line in the body tag:
onLoad="window.document.${application}.focus();" 

That works in IE but I can't get FF(3.0.4) to work.  One of the link I listed 
in an earlier post suggested adding this line to get FF to play nice as FF has 
a known issue with the embed tag:
   <param name="wmode" value="opaque" />
and
   <embed ... wmode="opaque" ...></embed>

But none of this is working with FF.  I may have to let this go and thank my 
lucky stars my clients are all internal and most of them use IE!

Thanks for all the support.
-Robert

--- On Fri, 12/5/08, Tracy Spratt <[EMAIL PROTECTED]> wrote:
From: Tracy Spratt <[EMAIL PROTECTED]>
Subject: RE: [flexcoders] txtbx focus at login
To: [email protected]
Date: Friday, December 5, 2008, 6:23 PM








 
 

 

 

 







This works in IE: 

   

window.onload =
setFocusOnLoad; 

function setFocusOnLoad(){ 

      ${swf}.focus(); 

} 

   









From:
 [email protected] [mailto:
 [email protected] ] On Behalf Of Robert Byrne

Sent: Friday, December 05, 2008
4:34 PM

To: [email protected]

Subject: RE: [flexcoders] txtbx
focus at login 



   








 
  
  I'm looking into this now, but won't get back to it
  for a while: http://www.igorcost a.org/?p= 179

  

  There also a bit about it here: http://www.htmlforu ms.com/archive/ 
index.php/ t-64150.html

  

  Thanks for the pointers.

  -Robert

  

  

  --- On Fri, 12/5/08, Tracy Spratt <[EMAIL PROTECTED] com>
  wrote: 
  From: Tracy Spratt
  <[EMAIL PROTECTED] com>

  Subject: RE: [flexcoders] txtbx focus at login

  To: [EMAIL PROTECTED] ups.com

  Date: Friday, December 5, 2008, 3:35 PM 
  
  
  This is because the Flash Player instance itself (Object/Embed
  tag) does not have the focus in the Browser.  There is a bit of
  javascript code that will set the focus, but last I heard it only works in
  IE.  I can find that script if it would be useful. 
    
  
Tracy 
    
  
  
  
  
  From: [EMAIL PROTECTED] ups.com 
  [mailto: [EMAIL PROTECTED] ups.com 
  ] On Behalf Of Robert Byrne

  Sent: Friday, December 05, 2008
  1:25 PM

  To: [EMAIL PROTECTED] ups.com

  Subject: [flexcoders] txtbx
  focus at login 
  
    
  
  
  
  
   
    
    
    This is a bit
    odd.  When I first open the application, the focus IS set on the login
    txtbx but when I start typing nothing happens.

    

    If I tab to the password txtbx I can type.  If I tab back to the
    login, I can type.

    

    If I click anywhere on the flex app, not just in the login txtbx, I can
    type.

    

    I know the focus is on the login txtbx because there is an orange box
    around it.  When tabbing to the password, the orange box moves to the
    password.

    

    I tried setting focus to the flash object in the html wrapper within a
    window.onload event using both focus() and click().  Nothing.

    

    Any ideas?

    Thanks - Robert.

    

    Here's some code:

    

    MXML:

    

    <mx:Label text="@Resource( key='loginId' , bundle='Labels' )"
    fontWeight=" bold" width="60" />

    <mx:TextInput id="usernameInput" width="140" />

    

    AS:

    override protected function init():void{

      super.init() ;

      this.logger. debug("init" );

    

      this.loginForm. defaultButton = this.loginButton;

      this.usernameInput. setFocus( );

    } 
    
    
   
  
    
  
  
  
  
  
  
 


   







 

        
        



      

Reply via email to