I have an AS3 function that runs when a URLRequest fails. I need to be able to use this function to assign global variables that I can then check against using other functions. How do I assign global variables inside of a function?
Thanks!
Edit:This is the variable (soundFile2Exist) I am trying to get outside of my function:
function onIOError(e:IOErrorEvent):void
{
var soundFile2exist = null;
trace (soundFile2exist);
}
I am not using my code inside of a packge. Is there still a way to do this?
function playMusic(evt:MouseEvent):void
{
channel = myMusic.play(songPosition);
if (soundFile2exist != null) {
channel2 = myMusic2.play(channel.position);
}
myTimer.start();
btnPlay.mouseEnabled = false;
trace (soundFile2exist);
}