I'm trying to access the variables outside a function but can't seem to figure out what I'm doing wrong. I've combed through google & tutorials but still can't seem to find the answer.
I've got a perl script that returns the variable "serverDate" I want to be able to manipulate this string from there (it's a lot of lenghty code that works. I'm just trying to modularize & parameterize for portability) when I access the variable inside the funtion, it works great. but outside the function it's empty, even using "return"
any thoughts?
myLoadVar = new LoadVars ();
myLoadVar.load("time.pl");
myLoadVar.onLoad = function (success) {
if (success == true) {
trace("myLoadVar success");
serverDtTm = myLoadVar.serverDate;
//trace("serverDtTm: " +serverDtTm); return serverDate;
} // if (success == true)
return serverDate;
} // END myLoadVar.onLoad = function...
trace("myLoadVar.serverDtTm : " + myLoadVar.serverDtTm );
I've got a perl script that returns the variable "serverDate" I want to be able to manipulate this string from there (it's a lot of lenghty code that works. I'm just trying to modularize & parameterize for portability) when I access the variable inside the funtion, it works great. but outside the function it's empty, even using "return"
any thoughts?
myLoadVar = new LoadVars ();
myLoadVar.load("time.pl");
myLoadVar.onLoad = function (success) {
if (success == true) {
trace("myLoadVar success");
serverDtTm = myLoadVar.serverDate;
//trace("serverDtTm: " +serverDtTm); return serverDate;
} // if (success == true)
return serverDate;
} // END myLoadVar.onLoad = function...
trace("myLoadVar.serverDtTm : " + myLoadVar.serverDtTm );