|
   |
|
|
Flash CS3 Tutorial
Here is a lesson on Creating Event Listeners in Flash CS3 and ActionScript 3.0. Go to www.frenchsquared.com for full tutorials. Event Listeners An Event is something that happens, such as a mouse click that Flash can respond to. Events are often things a user does, such as pressing a key or moving the mouse, but events do not have to be user initiated. A function ending or a sound playing can also trigger a response from Flash. Flash and ActionScript needs a way to detect and respond to these events. An event listener or event handler is created to give your object the ability to hear. In basic terms an event lister is something that tells Flash to do this when that happens. Sounds similar to a function, but this event can be user initiated. ActionScript Copy and past the example code onto the empty key frame on the actions layer. Remember that objects need to be named. In this tutorial we have already named the circle yourObject_mc. function onClick (yourObject_mc:MouseEvent):void { trace("yourObject has been clicked") }; yourObject_mc.addEventListener (MouseEvent.CLICK, onClick); Press Control-Enter and Test your Movie. So first you created a function called onClick you then told Flash that onClick would used with yourObject_mc and a MouseEvent, :Void is the data type tag. You currently set it to Void. Everything inside the {} is the actually action you want to happen, in this case trace "your object has been clicked". The last part is when you actually gave the MovieClip yourObject_mc the ability to hear. You added an event listener to yourObject_mc by first defining the name of the object you want the event listener applied to. (yourObject_mc). Next, addEventListner was applied to the named object. Finally, you defined the event listener by filling in the parameters (MouseEvent.Click, onClick). |
Flash Tutorials
| Flash tutorial on Squidoo
PLEASE VISIT THE CONTRIBUTOR'S WEBSITE
FrenchSquared
Website dedicated to Flash Tutorials
FrenchSquared.com
|
|
No reactions yet.
Please login or sign up to rate this intel.
Please login or sign up to add a comment.
The copyright for this content entitled "Flash CS3 Tutorial " has been specified by the contributor as:
All Rights Reserved
This content may not be copied, distributed or adapted by anyone under any circumstances.
|
 |
May, 2012
2008
January, February, March, April, May, June, July, August, September, October, November, December
2009
January, February, March, April, May, June, July, August, September, October, November, December
2010
January, February, March, April, May, June, July, August, September, October, November, December
2011
January, February, March, April, May, June, July, August, September, October, November, December
2012
January, February, March, April, May
|
|
Not a member yet?
Qondio is a powerful network for making it online. If you have a website to
promote, we can help.
Sign up and get in on the action.
|
|
Welcome to Qondio! Discover the awesome power this network can deliver by going to our About page. Or you could skip straight to the Sign Up form.
|
|