010 Event Listeners and Event Handlers

What are Event Listeners? 

A flash interface is a busy place. There’s a lot going on – cursors are moving around, buttons and keys are being pressed, the playback head is moving about, time is passing, graphics are appearing and disappearing. Flash happily ignores all of these events unless it is instructed to pay attention..

As a child I would ignore the fact that an alarm clock was ringing next to my bed. I was not inclined to respond to this event. Fortunately, mum instructed me  to listen for this event and handle it by carrying out a procedure known as  ‘get ready for school NOW!’.

Dave.addEventListener(Event.ALARM, GetReadyForSchoolNOW);

function GetReadyForSchoolNOW(){
          // drag myself out of bed ;
         // stagger to bathroom ;
        // ect..

}

You can create listeners for many different flash events.

Find out more than you ever wanted to know about listeners from Adobe Developer Connection’s  Introduction to event handling in ActionScript 3.0.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s