Login
...or Sign up
Home
Search
Search Code Snippets
Search People
AS3 - Finding array indexes
var colors:Array = new Array (red_mc, blue_mc, yellow_mc); stage.addEventListener(MouseEvent.CLICK, captureAllClicks); /*red_mc.addEventListener(MouseEvent.CLICK, captureAllClicks); blue_mc.addEventListener(MouseEvent.CLICK, captureAllClicks); yellow_mc.addEventListener(MouseEvent.CLICK, captureAllClicks);*/ /*function captureAllClicks (event:MouseEvent):void { trace(event.target.name); }*/ function captureAllClicks (event:MouseEvent):void { trace(colors.indexOf(event.target)); }
Score: 0/10
Would you like to comment?
Sign up
for a free account or
sign in
(if you are already a member).
URL:
Embed:
Uploaded on 11/22/2009 5:45:58 AM
by
tpr
Programming Language:
ActionScript
Tags:
array
index
Viewed 185 times
Help
Help by email
What is Naslu?
|
About Naslu
|
Contact
|
Terms of Use
|
Downloads
|
Webprogramacion.com
|
Blog
|
Top
Links
Select language:
Español
|
English
© 2009 naslu.com