<< 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
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.)
Notification Switch
Would you like to follow the 'Introduction to xml' conversation and receive update notifications?