|Flex Framework Basics
- MXML (Macromedia
- Declarative language to define User Interface
- Similar to XHTML
- User Interface
- Buttons, ComboBoxes, Layout Managers, Containers,
- Class Libraries
- Everything in the flash.* and mx.* packages
- Validation Routines, Web Services, DataTypes
- A rich set of User Interface components, via its
declarative MXML language.
- It can be used to deliver the presentation layer of
- An object oriented development language (Action
Script) that can be used to
develop significant client logic.
- A variety of integration mechanisms (Flex Data
Services) to allow Flex client Applications
to connect to back-end server components.
- Data Binding mechanism which allows graphical
components to be bound directly
to data sources.
- Flex’s declarative MXML language provides a wide
range of components
to ease the development of RIA.
LinkBar, MenuBar, ViewStack
- Button, CheckBox, ComboBox, DataGrid, TextInput,
List, Label, Tree
Testing Flex application
- The ActionScript programming language is used in
Adobe’s Flash Player
- It is included built-in objects and functions that
allow you to create your own objects
and functions like many object-orientated programming (OOP) languages.
is the the first version to have full support for Object oriented
- A unit testing framework for Flex and Action Script
3.0 applications and libraries.
- It mimics the functionality of JUnit.
Difference between Flex
HTML vs Flex vs Flash
- Flash has been designed to facilitate the creation of
whereas Flex is geared toward application development.
- Flash stores your application structure in a binary
whereas Flex uses a text file based on the markup language of Flex,
- Each tool also differs in the development model it
- Flex has no timeline, no library , no drawing tools.
Tools used For flex Programming
- Flex sdk is free, it can be downloaded and used.
- It is available for linux and window and
Flex Application using Flex Builder
- Open Adobe Flex Builder.
- Click on File-->New-------->Flex Project
- As Shown below.
- Now Give a suitable name to your project.
- As here we give it as MyFirstFlexAppliaction.
- Then select Application type as shown below.
- Then select Flex SDK version.
- Then click on next button.
- A default file for mxml will be created as shown
- Do the code in code view
- Similarly in design view drag and drop the
- Now set the property in property box
- As shown below.
- Now right click and select run as Flex Application
- This will open a browser and run in it as html file
in which swf file is embedded
Command line tools
to compile Flex 3.0
- Open command prompt
- Make a directory ,change into it
- Set path to flex-sdk\bin and to flashplayer in
- Now make a file in notepad
- Give .mxml extension for mxml file and .as
for ActionScript file
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal">
public function displayMe(input1:String):void
<mx:Button label="Display It" click="displayMe(thisTextInput.text)"/>
- Compile with mxmlc command.
- After compilation both action script file and mxml
file will produce MyFirstFlexProgram.swf file.
- As given below.
Testing of Flex 3.0
- Run it by command FlashPlayer MyFirstFlexProgram.swf
- You can also run it in internet browser which have
flash player plugin installed.