2 Replies Latest reply on Jan 23, 2009 5:50 PM by W_Bell

    textArea component - Listen for var

    W_Bell Level 1
      The odd time I get an "undefined" error when loading from an xml file.
      This only will happen on the initial first load image.

      There is already a listener for "complete" on the Loader
      that is used for the pogressBar and this works fine.
      The List "select(1)"event happens down the line a bit
      after all are present on Stage.

      This problem seems hard to re-create and usually happens
      with a bogged down internet connection where it seems the xml
      load times out and gives this error. As a back-up to address this
      problem I thought something like this would be a good to ensure
      the xml file to loads sucessfuly.

      The default text string value is "undefined" so is there a way to get this string
      in a variable and the re-select the list item if "unefined = true"
      similar to below?

      var my_loadtext:String = myText3.text;

      var listenerObject:Object = new Object();
      listenerObject.change = function(eventObject:Object) {
      myText3.onLoad = function(success) {
      if (success) {
      //Do Nothing
      } else {
      if (my_loadtext:String == undefined) {
      myList.select(1);
      }
      }
      };
      };
      myText3.addEventListener("change",listenerObject);