Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 4. Understanding the Anatomy of ... > Combining MXML and ActionScript

4.4. Combining MXML and ActionScript

You can accomplish many tasks with either MXML or ActionScript code, and only a few are restricted to one language or the other. Most Flex applications use both. The main application file is always in MXML, and that file can then contain or refer to ActionScript code in a variety of ways.

4.4.1. Using the <fx:Script> element

You can use the <fx:Script> element to wrap ActionScript code that becomes a part of the application or component that the current MXML file represents. The advantage of including the scripting in the MXML file is that all the code for a particular component is in one place. Disadvantages include:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial