MACROMEDIA FLEX BUILDER-USING FLEX BUILDER Use Manual page 147

Table of Contents

Advertisement

<!-- button that triggers the copy -->
<mx:Button id="myButton" label="Copy Text"
click="myText.text=myInput.text" />
<!-- output text box -->
<mx:TextArea id="myText" width="150" height="20" />
</mx:VBox>
</mx:Application>
The content between the starting and closing
Related topics
"Creating MXML or ActionScript files" on page 75
"Testing and debugging Flex files" on page 83
Flex ActionScript and MXML API Reference help
About ActionScript files in Flex applications
Although MXML is the primary authoring language for Flex applications, you use ActionScript
to manipulate and extend Flex applications. ActionScript is a procedural-based language similar
to JavaScript for manipulating Flash. For more information, see "Using ActionScript" in
Developing Flex Applications Help.
To use ActionScript in Flex applications, you must either add script blocks to the MXML file
using the
<mx:Script>
following example shows both methods.
<mx:Script>
var myVar:Number;
function doSomething() {
myVar = myVar + 1;
}
</mx:Script>
<mx:Script source="myscripts/file1.as"></mx:Script>
In general, maintaining an application is easier if you place the ActionScript in a separate file and
use the
source
If you add script blocks to an MXML file using the
using special characters within the script block.
A good coding practice is to "escape" all ActionScript blocks in your MXML files so that the
MXML parser ignores them. Because MXML is an XML-based language, the MXML parser will
interpret special XML characters such as angled brackets as MXML, not ActionScript.
tag, or reference external ActionScript files using the same tag. The
property of the
<mx:Script>
tags defines a Flex application.
<mx:Application>
tag to import it in the MXML file.
tag, you must be careful about
<mx:Script>
About Flex files
147

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX BUILDER-USING FLEX BUILDER and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex builder

Table of Contents