You have to set the instance variable to null. You can't set "this" to "null".
You want to make another class that handles the bullets.
It will contain
- a static array
- a static method for adding a new bullet into the static array
- a static method for updating the bullets (loops thru the array and calls a method in the bullet class)
- a static method for removing a bullet instance from the static array (make the bullet instance in the array a null).
In the bullet class you will call the static method for remoting a bullet instance (pass "this" as parameter) when you want to delete the bullet.
var Test:SomeClass = new SomeClass(); trace(Test); // --> [object SomeClass] Test = null; trace(Test); // --> null
You want to make another class that handles the bullets.
It will contain
- a static array
- a static method for adding a new bullet into the static array
- a static method for updating the bullets (loops thru the array and calls a method in the bullet class)
- a static method for removing a bullet instance from the static array (make the bullet instance in the array a null).
In the bullet class you will call the static method for remoting a bullet instance (pass "this" as parameter) when you want to delete the bullet.