Can anyone explain how I can call a variable outside of a function?
What I mean is, if I define a variable inside a function and then try and trace that variable anywhere outside the function all I get is undefined.
For example if I were to try this:
onLoad=function(){
myVariable="variable";
}
trace(myVariable);
The output box would say undefined.
Is there a way round this? I have tried _root and _global but that doesnt work either.
My problem is I am trying to load a variable from an XML file using the variable as the name of a video that needs to be attached to a netstream class. I can load the variable inside a function without any problems, but netstream will not work inside a function and I cannot pass the variable outside of the fucntion.
Any ideas?
Thanks