00:00
00:00
Newgrounds Background Image Theme

Crakie20 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Browse Sections

Newgrounds Wiki: addEventListener

Usage

import com.newgrounds.API;
API.addEventListener(event:String, listener:Function[, target:*]);
  • event - The event name to check. This should be one of the constants in APIEvent.
  • listener - The function that will run when the event is triggered.
  • target - The object or movieclip that "this" should refer to from inside the listener function. (Actionscript 2.0 ONLY!!!)

This method adds a listener to the requested event. When the event is triggered, your listener function will run.

See the API Events page for more details.