6 Replies Latest reply on Feb 15, 2007 3:01 PM by NoNickNeeded

    GetVarialbe(); SetVariable(); not working as expected?

      Hello, I'm trying to understand how GetVariable() and SetVariable() work.

      I've written the following ActionScript code in the actions frame of the top layer in my .fla:

      testVar = "test1";
      getVar = GetVariable("testVar");
      SetVariable("testVar", "test2");
      getVar2 = GetVariable("testVar");

      When I walk through this code in the debugger, I don't see the expected behavior:
      getVar - remains undefined
      testVar - does not get assigned "test2" like I thought it would by calling SetVariable()
      getVar2 - remains undefined.

      I'm guessing it has something to do with variable scoping or something like that, but I'm not sure what.

      Any help?

      Thanks in advance.