1 Reply Latest reply on Mar 28, 2007 5:56 PM by Newsgroup_User

    When :LoadVars is sloooow

    BobAchgill
      When using :LoadVars and .load to load my variables... how can I keep from going on to processing in the next frames (that will use those variables) until the load is finished? Here is what my code looks like now.

      +++++++++++++++++++++++++++++++++++++++++++++
      var Menu_Story:LoadVars = new LoadVars();
      Menu_Story.onLoad = function (success3:Boolean):Void {
      if (success3) {
      trace("Yes, able to load external file with variables."
      } else {
      trace("Unable to load external file with variables."
      }
      }
      //Load Menu_Story variables
      Menu_Story.load("Menu_Story.txt", _root);
        • 1. Re: When :LoadVars is sloooow
          Level 7
          BobAchgill,

          > When using :LoadVars and .load to load my variables...
          > how can I keep from going on to processing in the next
          > frames (that will use those variables) until the load is
          > finished?

          Given your sample code ...

          > Menu_Story.onLoad = function (success3:Boolean):Void {
          > if (success3) {
          > trace("Yes, able to load external file with variables."
          > } else {
          > trace("Unable to load external file with variables."
          > }
          > }

          ... I'd say you've nailed it. Outside of any of this code, stop the
          timeline -- stop() or this.stop() -- and start the timeline again in if that
          success parameter is true. Is that what you're asking?


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."