Flex and Action Script What is Flex Adobe
Flex and Action. Script
What is Flex? • Adobe Flex is a rich Internet application framework built on top of the Flash platform • Applications are built using MXML and Action. Script • Applications are compiled into SWF (Flash) files • Whether written in MXML or Action. Script, all Flex components are classes. • At compile time, MXML is precompiled to Action. Script classes, which are then compiled into the swf file format.
Action. Script • • Object-Oriented Programming Language Encapsulation Abstraction Inheritance Polymorphism Reusability Similar to Java. Script
Properties • Each class has pre-defined set of properties • Example: Camera properties include bandwidth, height, width mycam=new Camera(); //creates new object mycam. height=20; //setting value of property • You can define and change the properties of each object (instance) of a Class through Action. Script
Methods • An action that is performed by an object • Example: Camera class has get. Camera method • Calling a method mycam=new camera(); //create an object mycam. get. Camera(); //calling method
Events • Events are actions that occur in response to user’s interaction • The technique for specifying certain actions that should be performed in response to particular events is known as event handling • Example function event. Response(event: Mouse. Event): void { // Actions performed in response to the event go here } my. Button. add. Event. Listener(Mouse. Event. CLICK, event. Response);
Functions • Defining a function. Name(){ Statement 1; Statement 2; } • Invoking a function. Name();
Flash Media Server and Action. Script • • Client-side Action. Script compiled to swf Web Server plays swf Server-side Action. Script code is invoked Sever loads application
Client-side and server-side objects
Connection Flow
Calling client-side function from server-side code
Calling server-side function from client-side code
Client-side calls on the left invoke server-side calls on the right
Server-side calls on the left invoke client-side calls on the right
- Slides: 14