Join Joseph Labrecque for an in-depth discussion in this video Events, part of Learning ActionScript.
ActionScript 3 has a robust and flexible event model. …In this lesson, we'll explore how to listen for, and respond to, events within …Action Script. So here, I have a basic shell of a class, …there's really nothing going on here yet. And what we're going to want to do is in this …case, we'll set this up to listen for mouse events. …Specifically, click events from a mouse. And based upon the x and y position of …the cursor, what we'll do is trace out those numbers in the Console window.…
So, to do this, in our Constructor Function, we're going to add an event …listener to the stage. When we refer to the stage in …ActionScript, we're talking about basically the visible area that you can …see when you run a SWF or an AIR file or something like that. …It's your, your visible workspace. So, here we'll say stage.addEventListener.…
So, what type of event listener? You can see here that there is all sorts …of different events that we can use, and you can pick any one you want. …In this case, again we're going to use MouseEvent.CLICK to detect mouse clicks. …
- What is ActionScript and why should I learn it?
- ActionScript 2.0 vs. ActionScript 3.0
- Implementing external source code
- Working in Flash Professional and Flash Builder
- Understanding language fundamentals
- Working with ActionScript objects