JaiswalTraining

Get the online training        


Get Best Tutorial on all major programing language


Corejava Servlet Jsp  Php  Hibernate  Ajax Web Service   Ejb2.1 Ejb3.0 Struts Struts2  JPA Spring Ibatis   JSF    JSF2.0  CoreJavaDesignPattern    Jquery  Flex J2EE-Design-Patterns  Jboss7  Maven  Contact Me                                                                                                                                                                        
            IGNOU SMU PTU Project                                           Training                                                                                                                              
              

Contact Us  0091- 9210721663         jaiswaltraining@gmail.com




Corejava
Servlet
Jsp
Php
Hibernate
Ajax
Web Service
Ejb2.1
Ejb3.0
Struts  
Struts2
JPA
Spring
Ibatis
JSF
JSF2.0
CoreJavaDesignPattern
Jquery
Flex
J2EE-Design-Patterns
Jboss7
Maven







Flex Framework Basics

Overview
  • MXML (Macromedia XML)
    • Declarative language to define User Interface
    • Similar to XHTML
  • User Interface Components
    • Buttons, ComboBoxes, Layout Managers, Containers, Effects
  • Class Libraries
    • Everything in the flash.* and mx.* packages
    • Validation Routines, Web Services, DataTypes
Core Functionality
  • A rich set of User Interface components, via its declarative MXML language.
  • It can be used to deliver the presentation layer of an application.
  • 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.

MXML
  • Flex’s declarative MXML language provides a wide range of components
    to ease the development of RIA.
  • Containers
    •     - Layout
    •        Canvas, Form, VBox, HBox
  •  Navigation
    •       LinkBar, MenuBar, ViewStack
  • Controls
    • Button, CheckBox, ComboBox, DataGrid, TextInput, List, Label, Tree
ActionScript (AS3)
  • 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.
  • AS3 is the the first version to have full support for Object oriented programming
Testing Flex application
  • FlexUnit
    • A unit testing framework for Flex and Action Script 3.0 applications and  libraries.
    • It mimics the functionality of JUnit.
    • It is an open source.

Difference between Flex and Flash
  • Flash has been designed to facilitate the creation of interactive content,
    whereas Flex is geared toward application development.
  • Flash stores your application structure in a binary FLA file,
    whereas Flex uses a text file based on the markup language of Flex, MXML.
  • Each tool also differs in the development model it employs.
  • Flex has no timeline, no library , no drawing tools.
HTML vs Flex vs Flash



Tools used For flex Programming
    • Flex SDK
    • Flex Builder
    • Flex plugin for Eclipse
Flex SDK
  • Flex sdk is free, it can be downloaded and used.
  • It is available for  linux and window and Mac o/s.

A Simple 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 below.
  • Do the code in code view


</body></html>

  • Similarly in design view  drag and drop the control


  • 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





Ouput:-



Download zip Code

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   flex-sdk\runtime\player\win


  • Now make a file in notepad
  • Give .mxml extension for mxml file and .as for ActionScript file
MyFirstFlexProgram.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal">
  <mx:Script>
    <![CDATA[
      public function displayMe(input1:String):void
      {
        mx.controls.Alert.show(input1);
      }
    ]]>
  </mx:Script>
  <mx:TextInput id="thisTextInput"/>
  <mx:Button label="Display It" click="displayMe(thisTextInput.text)"/>
</mx:Application>
  • 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.






Download Code