1 Reply Latest reply on Sep 2, 2006 10:00 AM by 2m

    loadvars?

    jagguy99 Level 1
      q)I am confused between loadvars and loadvariables? I see 1 is for loading into a movie clip but why would you load data into a movie clip anyway?

      q)why use actionscript over using flash IDE, is it for speed reasons?
        • 1. Re: loadvars?
          2m Level 2
          to be frank, I don't really know where to start with your second question, so I'll begin with the first. (Strange introduction I guess ;-))

          loadVariables is a method of a movieclip as well as a global function it does exactly what you wrote: loading (and sending) Variables to and from a server side script or textfile.
          The LoadVars class does the same but with a lot more controll over what you do, e. g. you can decide to only load or only send or do both simultaniously; it also gives you methods to monitor the arrival of the data you requested.

          There are a milloin or more use-cases for that. For example if you have a game with a highscore, you might want to load all the scores at the moment when the user has finished playing the game so that you have all those results that where recived while he was playing in addition to those that were already on the server when you started playing.
          An other case would be to recive date and time at the end of the game from a server as sometimes the time on users machines aren't set right. Or you have a guesbook, where you want to load all the entries that are stored dynamically on a server to show up in your application etc...

          Concerning you second question:

          A there are a so much things you simply cannot do with the timeline only, start with simple if -> then statements up to steering objects throu a 3-dimensional space via your mouse, calculation shopping carts etc.

          If you are refering to those cases where you can do it both ways (say animatiing something along a straight line) it is in most cases only a question of personal liking which way to go, performance matters are, if at all not siginficant in the case I can think of now.
          If you have a highly interactive, actinscript ladden application it might be a lot more pracical to do the animation by AS only, while in a mostly timeline generated intro animation it might suite you much more to do the same thing with timeline tweens - so you dont have to switch between coding and animating all the time.

          I hope that answers your question.

          Markus