I tried to change the textfield on the stage from an external class but it doesn’t work.
Thats the code how I tried it:
package
{
import flash.display.*;
import flash.text.TextField;
public class Exp extends Sprite
{
public function Exp()
{
trace(stage.getChildByName("abc"));
TextField(stage.getChildByName("abc")).text = "abc";
}
}
}
On my stage I got a textfield wich is dynamically with the instancename: “abc”.
But everytime I start the program flash tells me stage.getChildByName(“abc”) would be a null-object.
I hope someone can help me.
I’ve never used getChildyName before.. You can just use this:
Or shorter:
If your example is your document class –