Using ActionScript in Flex applications

When you write a Flex application, you use MXML to lay out the user interface of your application, and you use ActionScript to handle the user interactions with the application. You can use a variety of methods to mix ActionScript and MXML. You can include inline ActionScript in MXML, or supplement a codeless MXML document with an external ActionScript controller class.

To use ActionScript in your Flex applications, you can add script blocks using the <mx:Script> tag or include external ActionScript files. In addition, you can import external class files or entire packages of class files for use by your MXML application. Flex extracts the ActionScript and creates a class file, which is linked to the final SWF file. For more information, see Techniques for separating ActionScript from MXML.

Note: In general, Macromedia recommends that you import ActionScript class files when possible rather than use <mx:Script> blocks in your MXML files or include snippets of ActionScript code from multiple files.


Version 1.5

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flex/15/flex_docs_en/00000046.htm