Introduction - Flex without Flash Builder

Flex, of course, the prefix was Adobe and is Apache now, is simply a Software Development Kit, should say free. Any SDK, would include few libraries, a compiler, and other stuff necessary to create some output file from one or more input files. The Flex SDK is similar to others and does the same job as other SDKs do.

Flex works with the following file extensions
  • Action Script (.as)
  • Macromedia eXtensible Markup Language (.mxml)
  • Shock Wave Flash (.swf)

The first two formats are input files, and obviously the third one is the output file. These two input files are fed into the MXML compiler to generate the output file. The process is depicted in the image below.

Since both of the input files are plain text, any text editor can be used to edit these Input files. I would prefer Notepad++, a very popular text editor used by programmers. If you do not have Notepad++, you can download here, or use an editor of your choice. Also, the coloring configuration for MXML and Action Script can be same as XML and Java Script respectively. Own coloring schemes can also be configured, but these styles are more suitable and readily available with any editor.

Lets take the MXML file first. The file looks like an ordinary XML file, primarily used for the design of the User Interface of the Flex. There are three common name spaces used in Flex. A namespace is something like a container, that holds different Classes and Identifiers. The popular name spaces are
  • []
  • [library://]
  • [library://]
The first URL defines the version of the MXML used in the file. The mx components are supported in all versions of Flex, but the spark components are new to Flex 4.

These name spaces include a lot of Classes useful for the design of the enriched User Interface.

The next file is the Action Script, where the actual logic of the program resides. The syntax and behavior is nearly similar to Java Scripting. The Action Script is generally event based, that is one event is triggered for each user action. For example, a Mouse Click event is generated on the Click action on a component. So to be simple, add an Event Listener to each of the control, and process those accordingly, and that creates a Flex application.

The two input files are fed to the Compiler which will generate the intended output swf file. The output file can be opened with Flash Player or any browser that has the Flash Player Plugin.

Flash Builder is an IDE, which makes the design and logic simple and interactive, but at a considerable amount of money to be paid for Licensing. Alternatively one can build the same Application without the IDE, but consumes a bit higher time. This blog is written for people who do not have the Flash Builder but have the Flex SDK. The Flex SDK is free and can be obtained from Adobe's website.

All the examples coded in this Blog, are developed without the Flash Builder IDE, and I just wanted to share my experience with others. Also this blog is written bearing useful content in mind. If you have any suggestions improving the content of this Blog, please drop a comment. I assure that every comment is valued more and be given importance.

See also Compiling Flex without Flash BuilderHello World in FlexIPv4 Validator in FlexCalculator in FlexSimple Animation in FlexMastering Alert - FlexNativeProcess - AIR.

No comments:

Post a Comment