Sunday, July 5, 2009

Defining a Default Button in Form and giving the style to form label

here i used defaultButton Property to make a default button in this Form
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Style>
.myformItemLabelStyle{
color: #333399;
fontSize: 20;
}
</mx:Style>

<mx:Script>
<![CDATA[
import mx.controls.Alert;
public function submitLogin(eve:MouseEvent):void{
Alert.show("Login Requested");
}
]]
>
</mx:Script>

<mx:Form id="myform" defaultButton="{mySubmitButton}">
<mx:FormItem label="Username" labelStyleName="myformItemLabelStyle">
<mx:TextInput id="userName" width="100"/>
</mx:FormItem>
<mx:FormItem label="Password" labelStyleName="myformItemLabelStyle">
<mx:TextInput id="password" width="100" displayAsPassword="true"/>
</mx:FormItem>
<mx:FormItem >
<mx:Button label="Login" id="mySubmitButton" click="submitLogin(event);"/>
<mx:Button label="Login" id="mySubmit" />
</mx:FormItem>
</mx:Form>
</mx:Application>

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home