Hi All,
Just a quick question…
As you’ll know, when it comes to removing an object from the scene you need to call removeChild via it’s parent.
Sometimes, but only sometimes, when it comes to remove an object it’s parent property is null. Why is this?! - it’s parent layer is still there, it’s as if it’s forgotten who it’s parent is!
Beyond the unsightly 1009 errors, this doesn’t seem to be giving me any problems and I’ve seen lots of people write code like this…
if (parent != null) { parent.removeChild(this); }
…which will fix the errors, but I just don’t understand why there is a problem to begin with!
Does anyone else know why objects might seemingly forget their parent?
Thanks