Hi guys,
I’m adding many custom classes on stage using the object.registerclass trick. Those classes all implement the same interface so I can call common functions for all of them. My problem is that I have many of those custom classes for which I keep a reference in the class where I’m attaching them to the stage with attachmovie. So, in this parent class, if I do a for in loop like this:
for (var key:String in this)
{
if (this[key] instanceof IMyInterface)
{
IMyInterface(this[key]).myFunction();
}
}
it loops through the display reference that I attached, but also through the reference of this attached class that I have in the parent class, so myFunction is called twice. Hope this makes sense…
My question is, is there a way (aside from comparing the key strings in the for in loop) to differentiate a display reference from a class reference?