This thing really drives me crazy. Can anybody help me? pleeeeaaaase.
Ok, I have two MC's. One is the Container MC and the other is loaded into. That works fine, no problem.
- Code: Select all
clip1:MyContainer (extends from MovieClip);
clip2:MediaContent (extends also from MovieClip and implements an Interface IRegister)
Then I load the clip2 into the clip1 (Container). Because I have various items in that container I iterate through
the container and compare the items as follows:
for (var i:int = 0; i < numChildren; i++ ) {
var child:IRegister = getChildAt(i) as IRegister;
if ( child != null ) {
child.register();
}
}
The problem is, though a trace( getChildAt(i) ) shows me a [object IRegister] the "as"- Operator never returns a result,
always null. I tried also with the is operator ( getChildAt(i) is IRegister). No way, it doesn't work. What's the problem?
If I compare with MovieClip it works. ( getChildAt(i) is MovieClip ) returns true;
thanks for help