Answered
Load variables from a perl script
Basically I want to load the date of the server from a Perl
script to my Flash. However it looks like the onLoad function
doesn't load successfully; it always goes to the else condition.
I've tried to put the Perl script & the SWF file in the
same/different directory. What i am doing wrong here? Please see
the scripts below:
**********************************************************
var externalData:LoadVars = new LoadVars();
externalData.onLoad = function(success:Boolean):Void{
if(success) {
theDate.text = externalData.serverDate;
} else {
theDate.text = "";
}
}
externalData.load("theDate.pl");
***************************************************************
theDate.pl
#!/usr/local/bin/perl
my $cYr = (localtime)[5]+1900;
my $cMth = (localtime)[4]+1;
my $cDay = (localtime)[3];
my $today = "$cMth/$cDay/$cYr";
print "&serverDate=", $today, "\n";
************************************************************
Thanks in advance
**********************************************************
var externalData:LoadVars = new LoadVars();
externalData.onLoad = function(success:Boolean):Void{
if(success) {
theDate.text = externalData.serverDate;
} else {
theDate.text = "";
}
}
externalData.load("theDate.pl");
***************************************************************
theDate.pl
#!/usr/local/bin/perl
my $cYr = (localtime)[5]+1900;
my $cMth = (localtime)[4]+1;
my $cDay = (localtime)[3];
my $today = "$cMth/$cDay/$cYr";
print "&serverDate=", $today, "\n";
************************************************************
Thanks in advance