TypeError: Error #2007: Parameter text must be non-null.
i have this error and i don't know how to solve it
TypeError: Error #2007: Parameter text must be non-null.
at flash.text::TextField/set text()
at glossary_fla::MainTimeline/createbtn()
at glossary_fla::MainTimeline/letterclick()
this is function createbtn
function createbtn(label:String):MovieClip
{
var txt:TextField = new TextField();
txt.defaultTextFormat = new TextFormat('Cooper Black',25,0xFFFFFF);
txt.text = label;
txt.autoSize = TextFieldAutoSize.LEFT;
txt.background = txt.border = false;
txt.selectable = false;
var btn:MovieClip = new MovieClip();
btn.mouseChildren = false;
btn.buttonMode = true;
btn.addChild(txt);
btn.label = label;
return btn;
}
and this function is letterclick
function letterclick(e:MouseEvent)
{
myxmllist = new XMLList(myxml.word.(@clas==e.target.name).@wordname);
for each (var word:XML in myxmllist)
{
btn = createbtn(myxmllist);
btn.x = 600;
btn.y = 130 + n;
addChild(btn);
n += 50;
btn.addEventListener(MouseEvent.CLICK,wordclick);
i++;
Tweener.addTween(btn, {x:100, scaleX:1, scaleY: 1, time: 2, transition:"easeOut"});
}
}
could you help me please
