private function createEqualSpacing(textfield : MovieClip, text : String, lastClip : MovieClip) : void
{
(textfield.txt).text = text;
(textfield.txt).multiline = true;
(textfield.txt).width = 420;
//Autosize textfield according to the text.
(textfield.txt).autosize = TextFieldAutoSize.LEFT;
(textfield.txt).border = true;
if(lastClip != null)
{
textfield.y = lastClip.y + lastClip.height + 20; //20 is fixed value space given between //textfields.
}
}
call the above function wherever required as below :
createEqualSpacing (mc1, xml.Text1, null);
createEqualSpacing (mc2, xml.Text2, mc2);
createEqualSpacing (mc3, xml.Text3, mc2);
{
(textfield.txt).text = text;
(textfield.txt).multiline = true;
(textfield.txt).width = 420;
//Autosize textfield according to the text.
(textfield.txt).autosize = TextFieldAutoSize.LEFT;
(textfield.txt).border = true;
if(lastClip != null)
{
textfield.y = lastClip.y + lastClip.height + 20; //20 is fixed value space given between //textfields.
}
}
call the above function wherever required as below :
createEqualSpacing (mc1, xml.Text1, null);
createEqualSpacing (mc2, xml.Text2, mc2);
createEqualSpacing (mc3, xml.Text3, mc2);
No comments:
Post a Comment