Flex3 Study Notes 2

Source: Internet
Author: User
Flex3 Study Notes 2

Flex script Basics

In general, mxml is used for application layout and structure design, and various action operations on the application are implemented using ActionScript.Recognize the key to understanding the flex framework by working with ActionScript and mxml.

1) Inline ActionScript
Inline ActionScript: contains the mxml tag of the script house. As follows:
<Mx: button id = "mybutton" Click = "somecomponent. someproperty = 'something'"/>
Or:
<Mx: button label = "Click me" Click = "fullnametextinput. Text = 'John Smith '"/>

2) Assignment
Changing the attribute value can be called "value assignment ". For example:
Fullnametextinput. Text = "John Smith ";
That is:
<Mx: button label = "Click me" Click = 'fullnametextinput. Text = "John Smith" '/>
If you want to do more than two things at a time, such as clicking a button. Simply add multiple statements as follows:
<Mx: button label = "Click me" Click = "fullnametextinput. Text = 'John Smith '; expertcheckbox. Selected = true"/>
Note: Use semicolons to separate statements.

3) Functions
A function is a reusable code block. You can put some ActionScript code in the function and give the function a name. When using the function, reference this function.
Function placement location: It can be placed in the tag of the mxml file. The tag is: <mx: script/>
<Mx: SCRIPT>
<! [CDATA [
// Your code goes here
]>
</MX: SCRIPT>

Related Article

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.