Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 02-13-2004, 11:01 AM   #1
Registered User
Join Date: Feb 2004
Posts: 49
Default Addressing dynamically created text fields?

I have a movie where I open an XML file, get the data, then I want to create a text field for each item under a particular node and set the text property to the "name" value for that node. What I can't figure out is how to properly address the textfield by name? I'm using a for...loop to create all of the text fields, so the names are "txt"+i - so how do I address the text field to set the value of it's text? Here's my code - please help!

(dta is the data loaded from the XML file as an object, bundle is a node, or a property of the object dta)

var max:Number = dta.bundle.length;
for (var i = 0; i < max; i++) {
this.createTextField("cat"+i,_root.depth++,100,100 ,200,15);
_root.cat[i].text = [dta.bundle[i].bname];

Every time I run this I just get "undefined" for each text field...

Thanks for the help!

eappell is offline   Reply With Quote
Old 02-13-2004, 12:09 PM   #2
red penguin
red penguin's Avatar
Join Date: Jun 2001
Location: Brooklyn, NY
Posts: 3,254



red penguin is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 08:28 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.