Flash development

Moderators: None (Apply to moderate this forum)
Number of threads: 227
Number of posts: 388

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Arrays Posted by RicardoFurtado on 21 Jan 2009 at 1:19 AM
I'm new to flash, and i'm trying to make my first game in AS3.
In the game i create several objects on screen, when the user presses a key (circles and squares), and the user has to click on them to delete them from screen.
I already know how to create the objects on screen
keyevent:

var xpto=new myClass;
myClass.x=RandomValue;
myClass.y=RandomValue;
addItem(myClass);

Now, how can i delete this object when the user clicks on it?
Ok, my guess is using arrays. I've search google and some books but it just seems i can't find the way. Don't i must have an eventListenner for every object in order to detect if the user clicked on it? if that is true, once i don't know the objects name at debugtime how can i add the events to them?

Does anyone has some code example or could give me some help?

My thanks in advanced



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.