2 Replies Latest reply on Jul 6, 2007 5:41 AM by Lipão

    global variable

    Manu Palasery

      I have laoded an XML file and assigned node values to an array through a function. Array values are names of images that has to be loaded dynamically into a movieclip and to rotate them as an AdRotator. I can't access the array values outside the scope of function. Is there any way to accomplish this.

        • 1. Re: global variable
          Greg Dove Level 4
          Make sure your array is declared outside of the scope of your function- which is perhaps running as a result of the XML.onLoad callback (and make sure its not declared inside your function as a local variable... otherwise the variable with the same name outside your function will not be altered).

          Feel free to post your code if that doesn't make sense (please use the attach Code button to do so otherwise it can get messed up)
          • 2. Re: global variable
            You can declare your array outside the onLoad event handle(using "var" keyword) and inside the onLoad using the push method to add elements to array (acessing you array without "var" keyword). Doing that your array is avaible outside your onLoad event handle.