Setting focus on a Flex app after its loaded

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”;
layout=”absolute” creationComplete=”onLoad(event)”>

import flash.external.ExternalInterface;

private function onLoad(event:Event):void {‘function browserFocus(){document.getElementById(\’PopUpWindow\’).focus();}’);‘browserFocus’);

<mx:VBox paddingTop=”100″>
<mx:Label text=”Username:” />
<mx:TextInput id=”uname” />
<mx:Label text=”Password:” />
<mx:TextInput id=”pwd” displayAsPassword=”true” />


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s