Pages

Friday, 30 March 2012

MXML Vs Action Script

MXML vs ActionScript 3.0

Flex components can be added to an application using MXML or ActionScript 3.0. Both code examples below display the same results.
previous page next page

MXML

Components are implicitly initialized when the user runs the application.

Form Layout in flex

The Form Layout Container

  • The Form container lets you:
    • Control the layout of a form.
    • Mark form fields as required or optional.
    • Handle error messages.
    • Bind your form data to the Flex data model to perform data checking and validation.

Thursday, 29 March 2012

UI Event in Flex(Button click and result handler)

Simple UI Event

Example 1

  • A click event is created by clicking the button
  • The click event triggers the event handler

Event Propagation in Flex

Event Propagation

Terms to know:
  • event.target: The target property refers to the dispatcher of the event
  • event.currentTarget: The currentTarget property refers to the current object that is processing the event

Event Handling in Flex

Event Listeners

Terms to know:
  • eventType: Event type broadcast by the object when an event occurs. This is represented as a String data type.
  • event listener: The function or class method that you write to respond to specific events. They're also known as event handlers.

Validators and Formatters example with Area Code Lookup in flex

Validators

  • Validators can be used to verify that data meets certain criteria on the client before being sent to the server.
  • Validation occurs when the field loses focus
  • Error message is displayed on mouseover
  • Indicate the source and source property, for example, mx:TextInput/text.

External Interface in Flex - Running Javascript in Flex

External Interface

The ExternalInterface class enables  communication between ActionScript and Flash Player containers such as an HTML page containing JavaScript and an embedded SWF file, or an application that has the Flash Player embedded in it. The communication is available in both directions. An HTTP/JavaScript page can call an ActionScript function which can return data that the JavaScript can use or ActionScript can call Javascript.

Wednesday, 28 March 2012

Flex Http Service Example for weather forecast from Yahoo

HTTP Service

  • Specify the format of returned external data as E4X using the resultFormat property of the HTTPService control.
  • Bind data between a UI component's properties and its dataProvider to enable changes in one to be reflected in the other.

Connecting two mxml applications using LocalConnection Object

Local Connections

  • A LocalConnection object is used to invoke a method in another LocalConnection object, either within a single SWF file or between multiple SWF files.
  • ActionScript 3.0 can communicate with LocalConnection objects created in ActionScript 1.0 or 2.0 and the reverse is true. Flash * Player handles this communication between LocalConnection objects of different versions automatically.

Shared Objects in Flex - Like cookies in the Browsers

Introduction:

Shared objects are like browser cookies however
  • They do not expire by default.
  • By default, they are limited to a size of 100 KB each.
  • They can store simple data types (such as String, Array, and Date).

Wednesday, 21 March 2012

Sample Remoting Application Using BlazeDS in flex with Java Object

 

After the configuration done with flex and blazeds Now you are ready to create an application in BlazeDS.BlazeDS communicates with flex using remoting-config.xml in which you will create the destinations. These destinations will refer to the java Objectswhich are available in java source path.

At first create a java Class HelloWorld.java. This class has a public function and will return a string message to the flex.

Wednesday, 7 March 2012

Configuring flex for Blaze DS

Linking Flex and Java can be achieved by BlazeDS.BlazeDS is a server-based Java remoting and web messaging technology that allows you to connect to back-end distributed data and push data to Adobe Flex and Adobe Integrated Runtime (AIR) Rich Internet applications (RIA). Because of its open licensing, BlazeDS is not precluded from being used with other client platforms, such as JavaScript/Ajax.

Monday, 5 March 2012

Sample Application using Swiz framework and BlazeDS Flex


About the Swiz Framework
Swiz is a framework for Adobe Flex and ActionScript that aims to bring complete simplicity to RIA development. Swiz provides:
  • Inversion of Control / Dependency Injection
  • Event handing and mediation
  • A simple life cycle for asynchronous remote methods
  • A framework that is decoupled from your application code