Tuesday, August 3, 2010

Flex Framework Registeration Form using UI


Flex Framework Registration form

Aim:
Use Label and TextInput and checkbox and combobox and radio button and button to develop the Registration form.

Procedure:

            Step 1:

                        Create project FlexPrject

            Step 2:

                        Create file RegisterDemo.mxml

                        Include following coding into the RegisterDemo.mxml



< ?xml version = '1.0' encoding = 'ISO-8859-1'? >
< mx:Application xmlns:mx = 'http://www.adobe.com/2006/mxml' >
< mx:Panel title="Register Form" height="500" width="500" >
< mx:Canvas >

< mx:Label text="Applicant Name" id="aname" x="10" y="30"/ >
< mx:TextInput id="apname" x="140" y="30"/ >

< mx:Label text="Select Country" id="countryr" x="10" y="80"/ >

< mx:ComboBox id="country" x="140" y="80" >
< mx:Array >
< mx:String > India < /mx:String >
< mx:String > Pakistan < /mx:String >
< mx:String > Columbo < /mx:String >
< /mx:Array >
< /mx:ComboBox >

< mx:Label id="sex" x="10" y="130" text="Sex"/ >

< mx:RadioButtonGroup id="ssex"/ >

< mx:RadioButton id="male" label="Male" x="140" y="130" group="{ssex}"/ >

< mx:RadioButton id="female" label="FeMale" x="200" y="130" group="{ssex}"/ >

< mx:Label id="hobby" text="Hobby" x="10" y="180"/ >

< mx:CheckBox id="reading" label="Reading Books" x="140" y="180"/ >
< mx:CheckBox id="playing" label="Playing Cricket" x="260" y="180"/ >
< mx:CheckBox id="watching" label="Watching TV" x="380" y="180"/ >

< mx:Label id="address" text="Address" x="10" y="230"/ >

< mx:TextArea id="Address" width="240" height="100" x="137" y="230"/ >

< /mx:Canvas >
< /mx:Panel >

< /mx:Application >

Step 3:

Include following coding into the build.xml

…..

< exec executable='${compiler}' failonerror='true' >
< arg line='-output F:\FLEXWORKSPACE\FlexProject\RegisterDemo.swf' / >
< arg line='F:\FLEXWORKSPACE\FlexProject\RegisterDemo.mxml' / >
< /exec >
…..

Step 4:

Run the Application


Step 5:

Open RegisterDemo.swf

Note:
you specify the directory to store swf file in build.xml

Get output

No comments:

Post a Comment