Come near Flex Assembly series (III): Press the torsion component

Source: Internet
Author: User

Go near the Flex Assembly series (III): Press the torsion component (Button,checkbox,linkbar,linkbutton,popupbutton,radiobutton,togglebuttonbar)

This article mainly introduces Flex button, Buttonbar, CheckBox, Linkbar, LinkButton, Popupbutton, RadioButton, Radiobuttongroup and Togglebuttonbar components, these components are very basic components, if you are learning the flex components can drift, this article is mainly for the Flex component beginners, I hope that the flex component of unfamiliar friends to play a role in some help.

One, button components

The above is the programming model for button:

1 <mx:Button x="341" y="24" label="Button" height="56" width="104"
2     enabled="true" fontSize="14" labelPlacement="right"
3     id="btn" click="onClick()">
4 </mx:Button>

From the above you can see that the button has a lot of properties, we just need to know a few key common properties ok. The following common properties:

1. Emphasized: Gets or sets a Boolean value that indicates whether a border is drawn around the button component when it is in a bouncing state. The default is:false

2, Label: Press the text displayed on the button.

3, Icon: Press the button on the display of icons. such as: icon= "@Embed (' images/mm-icon.png ')"

4, click: Click the button to monitor the method of the event. Other Super-knowledge, such as MouseMove, MouseOver, mouseout, rollover, RollOut, MouseDown, and mouseUp, can also be monitored in addition to click.

Second, Buttonbar components

The Buttonbar component can be understood as a composite component composed of multiple button components, each of which is a button.

1 <mx:ButtonBar x="100" y="307" id="btnBar" itemClick="clickHandler(event)">
2     <mx:dataProvider>
3         <mx:Array>
4             <mx:String>张三</mx:String>
5             <mx:String>李四</mx:String>
6             <mx:String>王五</mx:String>
7         </mx:Array>
8     </mx:dataProvider>
9 </mx:ButtonBar>

What needs to be remembered is its ItemClick event, as in the code above.

1 internal function clickHandler(evt:ItemClickEvent):void
2 {
3     //通过evt便可得到当前ButtonBar中的被触发Click事件的组件项
4     var label:String = evt.label;
5 }

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.