PDA

View Full Version : TitleWindow focus issue.


xithor
03-24-2006, 05:26 PM
I've got a problem with a TitleWindow not properly gaining focus at startup of the application...

I load up a TitleWindow as a PopUp. I then setFocus() on a text input box in that window. It highlights the input box in blue, but the focus is not really on it (can't type in it without manually selecting it). Then, if I hit tab to go to the next input box, it starts cycling through the items in my main canvas.

I'm using:
initialize="startUp();"
On my main canvas to kick off my startup function.
Below is the code I'm using to start up the window.


var loginWin:Object;
function startUp() {
loginWin=TitleWindow(PopUpManager.createPopUp(main Canvas, loginBox , true));
loginWin.mainApp = this;
loginWin.centerPopUp();
}


When I use the exact same code later on while running the app, it works fine. It's only on startup. I'm guessing it's related to the application not being fully initialized, but I can't find a way around that.

Any thoughts?

hangalot
03-24-2006, 07:26 PM
use creationComplete instead of initialize

xithor
03-24-2006, 09:25 PM
Yeah, I've tried that, didn't help any.

I've also tried using a good number of other things like validateNow, a number of different focus setting options I've seen suggested for other issues. I've tried callLater (not a great option, I know, but I've just been trying anything I can think of). I'm at a loss.

I'm a bit of a newbie with ActionScript, and tend to manage purely due to the similarities between AS and Java.

hangalot
03-24-2006, 09:47 PM
post an mxml application that recreates this please