Hi all, im making a game and it has enemies randomly spawning at the top of the screen going down to the bottom, so far it all works fine, except for when i try to remove them when they reach the bottom of the screen I get this error
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at spaceavoider/deleteenemy()[/Users/bobbymoranville/Desktop/space avoider/spaceavoiderclasses/spaceavoider.as:135]
at enemythree/garbagecollect()[/Users/bobbymoranville/Desktop/space avoider/spaceavoiderclasses/enemyone.as:43]
at enemythree/updatemove()[/Users/bobbymoranville/Desktop/space avoider/spaceavoiderclasses/enemyone.as:37]
I have tried every route to fixing this that i can think of but none so far has worked, any suggestions would be greatly apprieciated. :top_hat:
P.S. There are fourteen separate classes for the enemies, but they are all similar to the one i attached.