Tuesday, February 8, 2011

User Interface at Flex Part 1

In this chapter I will show you some example and how use component:
1. Alert
->This component use to display message at monitor.
Example:





import mx.events.CloseEvent;
import mx.controls.Alert;
private function init():void{
Alert.show("Simple Alert","Warning");
}
private function initUser(event:Event):void{
Alert.show("Choose yes or no ?","Warning",3,this,clickHandler);
}
private function clickHandler(event:CloseEvent):void{
if(event.detail==Alert.YES) {
Alert.show("User choose YES","Warning");
}else{
Alert.show("User choose NO","Warning");
}
}
]]>






Result:
User Interface User Alert Button:


User Interface Simple Alert Button:


2. ComboBox
Example of combo box:




import mx.controls.Alert;
import mx.events.MenuEvent;
private function clickHandler():void {
Alert.show(_comboBox.selectedLabel.toString(),"Warning");
}
]]>














Result:


3.List
->Display data list in one component.(In this application click at data do you want display a message alert).
Example:




import mx.controls.Alert;
private function clickHandler() :void{
Alert.show(_list.selectedItem.toString(),"Warning");
}
]]>




Data 1
Data 2
Data 3
Data 4





Result:


4. Tab Bar
Example:























Result:


Source Code:
Visual Component.rar

That's is it and for another component I will publish at next article. Thank you for see this tutorial I hope this tutorial can help you...Have a nice day all...^^

No comments:

Post a Comment