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.:
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.
I'm not sure what you mean, attach your files or a rough mock up
If you mean calling it from the library when its not on the stage, then something like so
var missil:missile = new missile();
missil.x = 50;
missil.y = 50;
missil.buttonMode = true;
I didn't explain it well but I found out the solution but thanks anyway. I put the following line in the constructor code for the missile class:
Click Here to Expand Forum to Full Width