Help Me Cursor Focusing Problem

4 views
Skip to first unread message

natarajan santosh

unread,
Apr 16, 2009, 10:19:47 AM4/16/09
to flex_...@googlegroups.com, flex...@googlegroups.com, chennai-fle...@googlegroups.com
Hi  Dudes,

I have 2 TextInput in my MXML Application , When i run the MXML Aplication i want to focus the cursor for first TextInput , I tried setFocus and focusManager while applicationComplete it was focusing but cursor is not inside TextInput


plz help me ...............


Thanks in advance
Natarajan V

vrathore

unread,
Apr 17, 2009, 1:11:38 AM4/17/09
to Flex India Community
Use

1. setFocus()
2. setSelection(0,0)

Cheers
Varun Rathore
http://www.vrathore.blogspot.com

Ravi Mishra

unread,
Apr 17, 2009, 2:47:26 AM4/17/09
to Flex India Community
Hi Natrajan,

swf files embedded in HTML don't get focus by default. you have to set
the focus on swf itself using javascipt.

in the body tag of index.template.html under html-template folder in
your project write the following:

onload="window.document.${application}.focus()"

something like this:

<body scroll="no" onload="window.document.${application}.focus()">

Note. this will work on IE only. (Not with Firefox)

HTH,

-Ravi

Flex Baby

unread,
Apr 18, 2009, 12:51:41 AM4/18/09
to Flex India Community
call this function on init() method.
it is work in IE & firefox only.
just copy & paste below code to init() method only

ExternalInterface.call('function browserFocus()' +
'{document.getElementById(\'index\').focus();}');

natarajan santosh

unread,
Apr 18, 2009, 12:31:32 AM4/18/09
to flex_...@googlegroups.com
Hi,

thanks for the reply can i give some small example for setSelection

2009/4/17 vrathore <vrath...@gmail.com>
Reply all
Reply to author
Forward
0 new messages