1.create a dynamic textbox name it "_counter" and set its variable as "counter" and put following script on frist frame of the movie or combine all within as sprite
| CODE | onLoad() { this.loadVariables("counter.php"); stop(); } |
2.create empty counter.txt and save it 3.now create counter.php file and put following PHP code in it
| CODE | <?
$filename="counter.txt"; if(!(@chmod($filename,0600))) report("Cannot write to file - $filename");
$counts=intval(loadfile($filename)); $counts++; if(savefile($filename,$counts)) report("$counts"); else report("Cannot write to file - $filename");
function savefile($fname,$data) { if(!file_exists($fname)) report("File nout found - $fname"); $f=fopen($fname,"w"); fwrite($f,$data); fclose($f); return true; } function loadfile($fname) { if(!file_exists($fname)) report("File nout found - $fname"); $f=fopen($fname,"r"); $data=fread($f,filesize($fname)); fclose($f); return $data; }
function report($msg) { die("&counter=$msg&"); }
?> |
export your movie upload and test
|