1 Reply Latest reply on Jul 6, 2006 7:11 AM by samdl1

    Create dynamic global variable?

    Marcílio_Catarino
      It is possible to create dynamically a global variable? I started to develop a Flash application that load some external variables (loadVars). I have to transform the loaded variables into global variables. The problem is that external txt file may to contain different variables names, and some variables sometimes may not exist. So, I can't know accurately which and how many variables must be transformed into globals. Somebody knows a way to do that?
        • 1. Re: Create dynamic global variable?
          samdl1 Level 1
          Why is it you need to make global vars? There are very few times when this is necessary.

          If it is appropriate I would recomend defining an array at the beginning of the script and then when your LoadVars object is loaded use a for...in loop and array.push() method to fill up the array with your LoadVars details.

          I'm sorry if this is unhelpful but you need to put down more info if you want a more concise answer

          Sam