I’m stunned as to why I cant access the textfield object placed inside a movieClip object. I’m doing this in a subclass as so:
I gave the movieClip an instance name of “myMC” and the
package {
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.text.TextFormatAlign;
import flash.text.TextFieldType;
import flash.text.TextField;
public class makeText extends MovieClip {
public var myMc:MovieClip;
public var mytext :TextField;
public function makeText () {
myMc= new MovieClip();
myMc.graphics.drawRect(0, 0, 300, 340);
myMc.name="myMc";
this.addChild(myMc);
mytext = new TextField();
mytext .htmlText="Testing";
mytext .name="mytext ";
myMc.addChild(mytext );
}
}
}
In my main document class I added this object as “maketext.”
These work as should:
trace(maketext.myMc) returns: “[object MovieClip]”
trace(maketext.MyMc.name) returns: “myMc”
Problem:
But trace(maketext.MyMc.mytext ) returns: “undefined”
I need to populate the textfield mytext inside the movieClip. How can I do that. Please help!