What is Flex?
Flex is a cross platform framework used in the development of Rich Internet Applications (RIA’s). Flex RIA’s are delivered in an SWF format, mainly used by Adobe Flash, which stores all the components and code used in the application.
The Flex framework is open source and can be downloaded from the Adobe website in the form of an SDK (Software Development Kit). Adobe also provides the Flex Builder, which comes with a GUI and has working views for coders and designers, as well as tools to speed up the development process.
How Flex Works
The graphical interface of an RIA is built with an XML based markup language called MXML, in where components can be easily added and customized.
A simple search text field with a button would look like this in MXML:
<mx:Label text=”Search:”/>
<mx:TextInput id=”searchTextField” enter=”search()”/>
<mx:Button label=”Search” click=”search()”/>
The search text field, label and button would usually be contained in a Box container and have properties similar to those of an HTML table.
<mx:HBox width=”400″ height=”150“
horizontalAlign=”center“
paddingBottom=”5” paddingLeft=”5” paddingRight=”5” paddingTop=”5“
horizontalScrollPolicy=”off” verticalScrollPolicy=”off“>
One neat feature in Flex is that data entered into a text field can be instantly validated using validation components provided such as:
<mx:PhoneNumberValidator id=”phoneValidator” source=”{phoneTextField}” property=”text” />
<mx:EmailValidator id=”emailValidator” source=”{emailTextField}” property=”text” />
Interactivity can also be added via ActionScript, the Flash native programming language.
<



No related posts.