|
This sample
shows you how Flash can interface with other server-side script
languages like ASP, PHP, or Perl CGI etc. In this sample,
we use Flash fscommand loadvariablesNum to read the text file
generated by
the ASP program.
- At
Frame 1, add the following fscommand to read the text file
generated by ASP program. We append a random number parameter
to the file name to force reloading the text file.
randomNum = Math.round(Math.random()*9999999999);
loadVariablesNum ("../tutor/aspInterface/info.txt?"+randomNum, 0);
- At
frame 2, add the following code to wait until the file is
completely loaded.
Note:
done is the last variable in the text file.
if (done == "1") {
done="0"
gotoAndPlay (5);
} else {
gotoAndPlay (2);
}
- At
frame 5, load the video file to playback.
Note: filename is the variable read from text file.
fscommand
("fas.avclip.unload");
fscommand ("fas.avclip.xy", "8,8");
fscommand ("fas.avclip.Autosize", "TRUE");
fscommand ("fas.avclip.load", filename);
stop ();
- The
server side script language response to get the input from
users and save the variables to text file for Flash to retrieve.
|