Skip navigation

There are times that you might want the stage to be listening for events, actually I can think of many reasons you’d want this. One very simple way is to add an enter frame event, this can be very useful things like games where you want a bunch of things to take place regularly and not use a timer. Anyway what ever the reason here is some super simple code to make a function call every time the stage enters the frame.

———– code sample

stage.addEventListener(Event.ENTER_FRAME, myFunction);

function myFunction(event:Event):void
{
        trace(“Function call performed on enter frame”);
}

———– end code sample

Nothing to fancy here, but someone somewhere night be looking for a solution and this would do it 🙂

Advertisements

2 Comments

    • wq
    • Posted July 23, 2009 at 9:02 am
    • Permalink

    thanks so much this really helped 😀

  1. You are most welcome, thank you.


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

%d bloggers like this: