Arrays - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.


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

var xpto=new 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
Sign In or Register to comment.