2 Replies Latest reply on Oct 2, 2007 9:11 AM by jeeepU

    htmlText troubles

    jeeepU Level 1
      Attached is the code. When I define the var wcode and then place it inside of a htmlText the variable doesnt show, leaving me with an undefined. No matter where I place it, nothing works. Does anyone know what is wrong with this?
        • 1. htmlText troubles
          Greg Dove Level 4
          2 things.
          A. You can't access any of my_xml's content until after my_xml.onLoad has run... which will be later than your code is running now, because its still downloading while your other code is executing. Forget about the onEnterFrame approach... just put all your code in the onLoad handler - or call an external function from the onLoad handler. Inside the onLoad handler 'this' refers to the XML object itself and not the timeline its running in. You should be ok with the code you have though I think.

          my_xml.onLoad = function(success:Boolean) {

          if (success) setUpWithDataNowItsLoaded();

          function setUpWithDataNowItsLoaded(){
          var wcode = my_xml.firstChild.firstChild.etcetera.....
          city_mc._location.text = my_xml.etcetera....

          trace('wcode is not undefined :'+wcode!=undefined)


          B. if wcode remains undefined after that change then its likely that you have a mismatch between the XML and the path to its value in your code.
          • 2. Re: htmlText troubles
            jeeepU Level 1
            Thank you a million GWD! A was correct.