<< Chapter < Page Chapter >> Page >

One of several ways to create applications for Flash Player (version 10 or later)

Flex 3 and Flex 4 (combined with ActionScript 3) simplyprovide one of several ways that developers can produce downloadable applications that will run in Adobe's Flash Player (version 10 or later) or Adobe Air (see Resources ) .

Running Flash Player

Very briefly, Adobe Flash Player normally runs applications in a web browser while Adobe Air runs applications in a stand alone mode from the desktop.However, if you have installed Flex Builder 3 or Flash Builder 4, it is usually possible to cause Flash Player to start and run in a stand alone mode by double clicking on an swf file. (See Figure 1.) If double clicking doesn't work, you can locate and run the file namedFlashPlayer.exe. Once the Flash Player is running, you can open and run other swf files.

Why do I care about Flex and Flash Player?

One of the fastest growing segments of the game programming industry is the area of social games that typically run in Flash Player. I currently teach a coursetitled "Game Development using C++" and another course titled "Game and Simulation Programming I : C#" based on Microsoft's XNA Game Studio. I have a long-term interest inpossibly also teaching a course in "Game Development using Flex and ActionScript."

Flex and ActionScript

However, my more immediate interest is related to two other courses that I teach. One of those courses is an introduction to XML. The other course isObject-Oriented Programming using ActionScript 3.

Flex is an XML-based language that is used to produce mxml files. (In fact, Flex is simply a shorthand way of writing ActionScript program files. Whenyou compile Flex MXML files, they are automatically converted into ActionScript files before compilation.)

The resulting ActionScript files, along with other resources, are compiled into swf files that can beexecuted in Flash Player or Adobe Air.

Most of the lab projects in my XML course require the students to create Flex projects using both Flex 3 and Flex 4. Most of the lab projects in my more advanced ActionScript programming course require thestudents to use Flex as a launch pad for their ActionScript programs.

Flex SDK versus Flash Builder

Although it is possible to create Flex applications using nothing more than the free open source Flex SDKs (see Resources ) and a text editor, that can be tedious. Flash Builder 4 helps you to write mxml files containing layout and controls and makes theprocess somewhat more enjoyable. It will probably also help you to be more productive.

A complete Flex application

A complete Flex application consists of

  • One or more mxml files that may or may not embed ActionScript 3 code.
  • None, one or more ActionScript 3 files.
  • Various resource files such as image files, sound files, etc.

As mentioned earlier, these are compiled into a Flash swf file, which can be executed in either a Flash player or (in some cases) Adobe Air.

Division of responsibility

Flex provides the layout and control structure for the application in an XML format while ActionScript provides the program logic. (Of course, the whole thing can be written in ActionScript if you choose to do so.)

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Introduction to xml. OpenStax CNX. Dec 02, 2014 Download for free at https://legacy.cnx.org/content/col11207/1.18
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Introduction to xml' conversation and receive update notifications?

Ask