-
I need to know when an instance of a class is clicked
I know how to do this if the object to be clicked isn't an instance of a class i.e.:
missile.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
But what do I do if "missile" is a class object? Using above code I get an error because when the project is opened there aren't any instances of it to begin with. What changes do I make to above line and should it go in the main code or in the missile class code?
I also tried the below line in the class code for "missile" class but again it didn't work.
this.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|