我textfield
在movieclip中添加a并将其添加到背景bg中。这是代码::
box = new boxMc();
bg.addChild(box);
box.x=boxX;
box.y=boxY;
exampleText="<p class='sarath'>"+k+"</p>";
boxVal = new TextField()
box.addChild(boxVal);
boxVal.styleSheet=sheet;
boxVal.htmlText=exampleText;
boxX=boxX+28
boxArray.push(box)
现在我想从文本框中检索文本boxVal
..我尝试如下::
for(var j:Number =0;j<boxArray.length;j++)
{
var mc:MovieClip = boxArray[j] as MovieClip;
trace(mc.getChildAt(1).text)
}
跟踪时mc.getChild(1)
,它显示为TEXTFIELD
,但trace(mc.getChildAt(1).text)
给我以下错误
1119: Access of possibly undefined property text through a reference with static type flash.display:DisplayObject.