Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating TextField

Status
Not open for further replies.

ice78991

Programmer
Joined
Nov 20, 2006
Messages
216
I am using actionscript to generate a set of links at the top of my page. I am creating a movie clip which contains a textfield for the label.

I am using the following code but cannot create the textfield

trace(mc) shows the clip but trace(this["link"+i+"_txt"]); returns undefined.



for(var i:Number = 0; i< 3; i++)
{

var mc:MovieClip = createEmptyMovieClip("link"+i+"_mc",i);
mc.createTextField("link"+i+"_txt",1,0,0);

trace(mc);
trace(this["link"+i+"_txt"]);
trace(mc["link"+i+"_txt"]);
}
 
Code:
for(var i:Number = 0; i< 3; i++)
    {

var mc:MovieClip = createEmptyMovieClip("link"+i+"_mc",i);
mc.createTextField("links"+i+"_txt",this.getNextHighestDepth(),50*i,0,100,20);      
        trace(mc);
		mc["links"+i+"_txt"].text="bill"
   
                trace(mc["links"+i+"_txt"]);
    }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top