I'm using script to replace some TextFields with instances of another class at runtime. Basically calling:
Code:
var par:DisplayObjectContainer = textfield.parent;
var idx:int = par.getChildIndex(textfield);
//remove tf from parent
par.removeChildAt(idx);
//add self in place!
par.addChildAt(this, idx);
In my code I'm also adding the textfield as a child of the new instance, but I'm pretty sure that doesn't matter to this issue. Also possibly important, the parent seems to be MainTimeline. The problem is that the new instances appear on all (subsequent?) frames, whereas the TextFields they replaced were only on a particular frame. Is there a way to preserve the frame association?