creating text boxes

  • BardicKnowledge
  • Novice
  • Novice
  • BardicKnowledge
  • Posts: 21
  • Loc: Halifax

Post 3+ Months Ago

I don't know what I'm doing wrong here. I know this shouldn't be hard but it's eluding me.

Anyways, what I'm trying to do is create text boxes using a for loop that reads a XML. I was to use a value from the XML for the text box instance name and a value for, well, the value of the textbox.

I have tested the xml, so I know the problem isn't there. The two problems I have mainly are 1) The text box isn't being create/or displayed while in the loop (works if I take the look out) and 2) the text box won't display the xml value when I use the XML to give the text box a value. If I for instance just call it cat, and assign it the value from the XML it works but when I try to use the XML to give the textbox an instance name and then give it a value from the XML it doesn't work.

Here's my AS:
Code: [ Select ]
var nav:XML = new XML();
nav.load("nav.xml");
nav.onLoad = startXML;
nav.ignoreWhite = true;

function startXML(){
    rootNode = nav.firstChild;
    fileLength = rootNode.childNodes;
    yy =0;
    for(i=0;i<fileLength.length;i++){
        rage = rootNode.firstChild.attributes.n;
        this.createTextField(rage, this.getNextHighestDepth(), yy, 10, 400, 22);    
        this[rage].html = true;
        this[rage].htmlText = rootNode.firstChild.attributes.n;
        yy+= 50;
    }
}

startXML();
  1. var nav:XML = new XML();
  2. nav.load("nav.xml");
  3. nav.onLoad = startXML;
  4. nav.ignoreWhite = true;
  5. function startXML(){
  6.     rootNode = nav.firstChild;
  7.     fileLength = rootNode.childNodes;
  8.     yy =0;
  9.     for(i=0;i<fileLength.length;i++){
  10.         rage = rootNode.firstChild.attributes.n;
  11.         this.createTextField(rage, this.getNextHighestDepth(), yy, 10, 400, 22);    
  12.         this[rage].html = true;
  13.         this[rage].htmlText = rootNode.firstChild.attributes.n;
  14.         yy+= 50;
  15.     }
  16. }
  17. startXML();


Thanks in advance for any help ^_^

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 8 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.