1 Reply Latest reply on Aug 16, 2006 11:52 AM by blemmo

    Problems with movie.createTextField in a loop

    serge_e
      Regarding this problem:

      After parsing an xml-file and looping through the nodes, i want to create text-fields in a movie (later that must become a scrolling ticker).
      Somehow that does not seem to work. I cannot use the instanceName ot textfield and fill it with text.

      This is the example code:

      var stock = stocks.childNodes;
      for (var i = 0; i<stock.length; i++) {
      currStock = stock ;
      stockName = currStock.firstChild.firstChild;
      stockPrice = currStock.childNodes[1].firstChild;
      stockDiv = currStock.lastChild.firstChild;
      stockId = currStock.attributes.id;
      stockStr = stockName + ' ' + stockPrice + ' ' + stockDiv + ' ';
      var txt_str:String = 'txt_' + i;

      _root.scroll_mv.createTextField(txt_str,int(i+1),int(xPos),30,24,30)
      txt_str = stockStr;

      Thanks and greetings - Serge