I have the following scenarios.
Main Class:
btnChangeText.addEventListener (MouseEvent.CLICK, onClick)
function onClick(e:MouseEvent)
{
var content:Content = new Content()
content.contentTxt= “Hello World”
content.initialize();
addChild(content);
}
Content Class:
public class Content extends Sprite
{
public var contentTxt:String;
public function Content()
{
txtField.text = “Lorem Ipsum” //this is the default text…
}
public function initialize()
{
txtField.text = contentTxt;
// lets assumed that we have already the textfield name txtField
}
}
now the question is that, how can I change the txtField.text without using the addChild function in the main class?? because the Content Class is already visible when you compile it… and when I remove the that addChild function, the txtField.text is still in its default value which is “Lorem Ipsum”