[Solved]Problem with splicing an Actor form an Array

I store all Actors in an array called allActors. For example:
Code:
allActors.push(reqjecActor);

Now when I nuke the Actor, Body and graphic I also want to clear the item from the array. My logic says:
Code:
var index:Number = allActors.indexOf(reqjecActor);
allActors.splice(index, 1);

But this doesn't work and gives the error:
1120: Access of undefined property reqjecActor.

What am I doing wrong and how can I fix this?
1. That doesn't sound like a Box2D related problem, but rather a basic ActionScript problem.
2. I don't think you're showing enough code to diagnose the issue anyway. For example, you don't show where you define reqjecActor, so as far as I know, it is indeed undefined.
I declare in reqjecActor in the function that I use to create a reqjec (createReqjec()):
Code:
var reqjecActor:Actor = new Actor(reqjecBody, graphic, "reqjec", i)

I guess that I have to declare the reqjecActor inside the package and put private/public infront of it right?
Er, yes, but inside the class, not just the package. Assuming all the code samples you have posted in this thread so far are all in the same class.
Al right it's working now... sorry for asking questions like this here but I'm restoring from a burnout. And the gray mass isn't working as it used to anymore, but it's getting there again slowly. 😀

Original thread: https://box2d.org/forum/viewtopic.php?t=1850