for example i have a public class Title with publicfunction destroy(); in it
than in my main class i create 1 sprite and some Titles than i sprite.addChild(title) for every title i have created which works ok.
i have tried invoking destroy method manually and it also works fine but when i try the following code flash builder reports error
while(sprite.numChildren > 0){
sprite.removeChildAt(0);
sprite.getChildAt(0).destroy();
}
error: 1061: Call to a possibly undefined method destroy through a reference with static type flash.display:DisplayObject.
I think the problem might be builder mybe can’t know that every child of sprite will be able to provide destroy(); method ( or in other words it shall be instance of class Title) … but how to tell him that it’s ok without exiting strict mode?