creating a dynamic text box inside a movieclip using a for loop


i having issues creating several dynamic text boxes inside movieclip using loop.  using 2.  here code have created far

 

var leading:number = 0;

function drawclip():void

{

    this.createemptymovieclip("mc", 10);

    for(i=0;i<5;i++)

    {

        mc.createtextfield("textboxes" + i, this.getnexthighestdepth(), 0, leading, 200, 200)

        mc["textboxes" + i].text = i;

        leading += 20;

    }

}

drawclip();

 

it create mc display number 5

 

any thoughts?

you cionstantly overwriting created textfield due using wrong depth definer.  pointing "this" depth value, planting inside "mc", going same depth since "this" 's depth index doesn't change.  use...

 

mc.createtextfield("textboxes" + i, mc.getnexthighestdepth(), 0, leading, 200, 200)



More discussions in Adobe Animate CC - General


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support