Asv3's Blog

September 12, 2009

Events, Listeners, Handlers

Filed under: flash — Tags: , , — asv3 @ 10:29 pm

An Event is happening of  noteworthy occurrence which is dispatched and listened for.  In ActionScript events can be categorized into two types.

  • built-in events
  • custom events

Built-in events describe changes to the state of the runtime environment, and Custom describe changes to the state of a program.

All event target objects are either inherited from EventDispatcher class or implement IEventDispatcher, this class provides 2 methods, addEventListener() and removeEventListener() for register and de-register listeners to event target objects.

To register and Event Listener to Event,

  1. Determine the Event target
  2. Determine type of Event
  3. Create an Event Listener to respond the event
  4. use addEventListener to register event with listener

example:

theURLLoader.addEventListener(Event.COMPLETE, someListener);

function someListener(e:Event){

        //do some thing with e.target

}

Event object type: flash.events.Event
Event.type property = flash.events.Event.COMPLETE
Listener = someListener

September 3, 2009

Overview Actionscript

Filed under: flash, flex — Tags: , , , — asv3 @ 4:30 pm

ActionScript is a programming language for Flash Player run-time environment. It was developed targeting designers to help them program interactivity. Today ActionScript enables efficient programming of flash applications ranging from Intros to complex, data-driven interactive applications.

ActionScript 1 started with Flash 5, which used “prototype” extensively to program interactive components for flash movies. ActionScript 2 was introduced with Flash MX 2004, which for the first time got Object Oriented concepts and implementations. Even though programmers using OOP methodologies final compiled binary was still using the ActionScript 1 format, hence the performance of flash applications were not that good by then.

Here came ActionScript 3, will lots on improvements over earlier version, AVM (ActionScript Virtual Machine) was written from the scratch, standardized components creation and usage methods. Closing up lot many security loop holes, still maintaining the backward support.

September 2, 2009

Introduction to ActionScript 3 using Flash CS3

Filed under: flash — Tags: , , — asv3 @ 4:55 pm

Coming days I am going to post tutorials on Introduction to ActionScript 3 using Flash CS3, Here are the topics I am planning to cover. for that sake we can keep flex thing aside for now, I will take it up later.

  • Overview
  • Introduction to Flash CS3
  • What’s new in ActionScript 3
  • Operators, Conditional Statements, Loops
  • Data Types
  • MovieClip Properties
  • Understanding Events, Listeners, Handlers
  • Mouse Events, KeyBoard Events
  • EnterFrame, Timer
  • Drawing API
  • Filters/Effects
  • Drag & Drop, Collision
  • Using Audio and Video
  • Simple Click-Through Prototype

Please feel free to comment

« Newer Posts

Blog at WordPress.com.