[font=Arial]Hi,[/font]
[font=Arial]Does anyone know how to modify the “**Hit Counter **in Flash using PHP” tutorial to use on multiple buttons in Flash for use as a click tracker?[/font]
[font=Arial]I have a flash movie with nearly 100 buttons that I would like to track mouse clicks.[/font]
[font=Arial]This is what I have so far:[/font]
[font=Arial]Filename is “counter.php” and the files will sit in the directory called “logs”.[/font]
[font=Arial]<?php [/font]
[font=Arial]$page = ($_GET[‘page’]); [/font]
[font=Arial]$logfile = “logs/” . $page . “.txt”; [/font]
[font=Arial]if (! @$file = fopen($logfile,“r+”)) [/font]
[font=Arial]{ [/font]
[font=Arial]$count=“1”; [/font]
[font=Arial]} [/font]
[font=Arial]else { [/font]
[font=Arial]$count = @fread($file, filesize($logfile)) or $count=0; [/font]
[font=Arial]fclose($file); [/font]
[font=Arial]$count++; [/font]
[font=Arial]} [/font]
[font=Arial]$count = file_get_contents($logfile); [/font]
[font=Arial]$count = explode("=", $count); [/font]
[font=Arial]$count[1] = $count[1]+1; [/font]
[font=Arial]$file = fopen($logfile, “w+”); [/font]
[font=Arial]fwrite($file, “count=”.$count[1]); [/font]
[font=Arial]fclose($file); [/font]
[font=Arial]print “count=”.$count[1]; [/font]
[font=Arial]?>[/font]
[font=Arial]And in Flash on each button I have this actionscript changing the end “button1”, “button2” etc:[/font]
[font=Arial]on (release) { [/font]
[font=Arial]this.loadVariables(“counter.php?page=button1”); [/font]
[font=Arial]gotoAndPlay(18); [/font]
[font=Arial]}[/font]
[color=black][font=Arial][size=2]The problem is that it writes the new text files if they don’t exist OK, but the count always remains at 1.[/size][/font][/color]
[font=Arial]Any help would be much appreciated. [/font]
[font=Arial]Thanks in advance! [/font]
[font=Arial]diceman[/font]