1 / 14

Flex and ActionScript

Flex and ActionScript. What is Flex?. Adobe Flex is a rich Internet application framework built on top of the Flash platform Applications are built using MXML and ActionScript Applications are compiled into SWF (Flash) files

diep
Download Presentation

Flex and ActionScript

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Flex and ActionScript

  2. What is Flex? • Adobe Flex is a rich Internet application framework built on top of the Flash platform • Applications are built using MXML and ActionScript • Applications are compiled into SWF (Flash) files • Whether written in MXML or ActionScript, all Flex components are classes. • At compile time, MXML is precompiled to ActionScript classes, which are then compiled into the swf file format.

  3. ActionScript • Object-Oriented Programming Language • Encapsulation • Abstraction • Inheritance • Polymorphism • Reusability • Similar to JavaScript

  4. 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 ActionScript

  5. Methods • An action that is performed by an object • Example: Camera class has getCamera method • Calling a method mycam=new camera();//create an object mycam.getCamera(); //calling method

  6. 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 eventResponse(event:MouseEvent):void { // Actions performed in response to the event go here } myButton.addEventListener(MouseEvent.CLICK, eventResponse);

  7. Functions • Defining a function function functionName(){ Statement1; Statement2; } • Invoking a function functionName();

  8. Flash Media Server and ActionScript • Client-side ActionScript compiled to swf • Web Server plays swf • Server-side ActionScript code is invoked • Sever loads application

  9. Client-side and server-side objects

  10. Connection Flow

  11. Calling client-side function from server-side code

  12. Calling server-side function from client-side code

  13. Client-side calls on the left invoke server-side calls on the right

  14. Server-side calls on the left invoke client-side calls on the right

More Related