Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
Srinivas S.M #1
SetFocus Problem
Hi Guys,
I have a Problem. I have TextInput Object which has to be selected by default
so that the user just start typeing anything in it when he first comes to that
page. I tried using setFocus() to that but the problem here i am facing is the
focus is draw on the component but i have to click in the TextInput to type in.
So please can anybody solve it or give me an idea to resolve this problem.
Srinivas S.M Guest
-
SetFocus
I would like to set the focus automatically to one of the textbox controls on my page, but so far on every page I load I have to set the cursor to... -
problem with TextInput.setFocus() in Form
The call setFocus on a TextInput in a form will not work unless the user has clicked on the movie. This means I have no way to set the default... -
setFocus();
Hi! I have one start file(swf) where i select language from, and when i have selected a language i go to another swf file... -
Conditional setfocus
"Mike Mueller" <mikemueller@ecinet.net> wrote: Mike, do you actually have table fields for each month for 2 years in one record? If so, you... -
textbox.setfocus
Hello! Is it possible on a form to set the focus on a field without having the hole filed selected? cause if I use textbox.setfocus, the hole... -
nif #2
setFocus problem
hi there,
i have an application that calls a login component i've made. in the login
component i have a function which i call with creationComplete. this function
basically resets the login form... here it is:
private function resetLogin():void {
username.text = "";
password.text = "";
username.setFocus();
//var fManager:FocusManager = new FocusManager(this);
//fManager.setFocus(username);
}
my problem is that setting the focus, whether i use FocusManager or simply say
username.setFocus() doesn't seem to work... the focusRect is drawn, but the
cursor doesn't focus within the username textInput area, which is the whole
purpose for me setting focus.
i've even tried calling the resetLogin function from the creationComplete
event of the Application, thinking that maybe this was an issue with the
application completing after the login component and stealing focus for some
reason. but it doesn't work.
does anyone know what i am doing wrong?
thanks,
nikki
nif Guest
-
nif #3
Re: setFocus problem
sorry... forgot to mention that when this method is called with a CloseEvent of an Alert, then it works perfectly fine. so the problem lies somewhere in the creationComplete area.
nif Guest
-
Mitek17 #4
Re: setFocus problem
Hi Nikki,
1. Do you call this component immediately at the startup of an application?
2. Do you use Firefox?
If yes - there is a porblem with Firefox - it does not pass a focus to the
loaded SWF automatically. Yoiu have to click on it first (or call an Alert()
and it will make the trick).
It works under IE though.
If no - you probably have another problem setting a focus.
Please read these threads:
[url]http://tech.groups.yahoo.com/group/flexcoders/message/102706[/url]
Cheers,
Dmitri.
Mitek17 Guest
-
nif #5
Re: setFocus problem
hi dimitri,
thanks for the reply.
mine is on startup, but not only happening in firefox, so i guess it must be
one of the other issues.
i will check out the those threads.
thanks a mil',
nikki
nif Guest
-
nif #6
Re: setFocus problem
hi dimitri,
i checked out that thread and tried the 2 suggested routes, but to no avail.
the focusRect displays, but focus is still not in the textInput area that i am
targetting.
here is my code, can you see where i am going wrong?
i call reset login from here:
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="258" height="76"
creationComplete="resetLogin()" keyUp="trySubmit(event)">
and then this is in a script block below:
public function resetLogin():void {
username.text = "";
password.text = "";
this.callLater(this.callLater,[setupFocus]);
}
public function setupFocus():void {
var fm:FocusManager = new FocusManager(this);
fm.setFocus(username);
fm.showFocus();
var sm:SystemManager = new SystemManager();
sm.activate(this);
}
thanks,
nikki
nif Guest
-
Mitek17 #7
Re: setFocus problem
Nikki,
Do you create this canvas using PopUpManager?
I would try the following:
private function setupFocus():void
{
username.setFocus()
}
And call this function from both creationComplete and updateComplete
eventHandlers.
PS In my quite complex case with multiple popups I ended up with simple
component.setFocus() call, but I am calling it upon
creationComplte/updateComplete with delay (callLater).
PPS Did you try InternetExplorer? AFAIK Safari has this problem too.
Mitek17 Guest
-
nif #8
Re: setFocus problem
hi dimitri,
i origionally had my code calling username.setFocus(), but graduated it to the
higher grade focusManager version in a hope that it would work... i have
reverted to the former with the delays in place, but to no avail.
i have also tried running it on updateComplete, also to no avail... oh boy
this is frustrating!
also, to note, when i call the logout from elsewhere, like when i click on my
logout button and thus return to the login screen, it works like a charm.
the canvas is called into the root level of the app (from my app's main mxml
file)... i think this is the problem, that it is called at application
initialization.
i have tried both ie and netscape... in fact i now compile into ie all the
time as i was having speed issues with firefox on my box.
i think i am going to try and call the login via as on creationComplete of the
app and not an mxml tag... perhaps that'll do it.
i will update here if it solves the problem... hold thumbs for me :)
thanks,
nikki
nif Guest
-
nif #9
Re: setFocus problem
*sigh*... nope, doesn't work. oh well, i guess the user will have to click in the username box when the app starts.
unless anyone has any other ideas?
nif Guest
-
Mitek17 #10
Re: setFocus problem
Nikki,
can you try to isolate the problem in you code and post it here?
PS Don't give up. It should have a solution :)
Cheers,
Dmitri.
Mitek17 Guest
-
nif #11
Re: setFocus problem
hi dimitri,
unfortunately i am stuck between a looming deadline and a hard place.
i fully intend to relook this once all my work is complete, but in terms of
priorities, this one has had to take a back seat to the entire sections i still
need to create and finish up by thursday morning... *groan*
when i relook, if i do find a solution, or at least figure out exactly what is
causing the issue, i will definately post here.
thanks for all of your help!
nikki
nif Guest
-



Reply With Quote


