Problems reloading with LoadVars from text file into flash 8 movie

I want to parse different variables to a flash movie header each time a different page is loaded… So I created a test movie that will loadvars from a text file which is created/modified by a php script on each page where the flash file resides.

it works ok for the first page but each time I navigate to the next … the datafile is changed with approptiate variables but the flash movie does not update … perhaps I am trying to do this wrong way … is there some way to ensure that flash reloads with LoadVars correctly?

Heres the an example of my php script in each page

 
//php script to pass php variable values to a text data file
$var= "var1" ;
$swf_file = "c1.swf";  
$dataFile = "data4flash.txt";// name of data file
//open/create a text file called "data4flash"
$fh = fopen($dataFile , 'w') or die("can't open file");
$pass2flash ="var=" . $var. "&" . "file=" .$swf_file;// data in URLEncoded, name-value pair format
fwrite($fh, $pass2flash); //write to data file - overwrite previous data
fclose($fh);

On each page there is a flash movie that just contains a button and two dynamic text fields which I use to display the contents of the text file created by php above

 
mybtn.onRelease = function () {
varsfromtxt = new LoadVars();
varsfromtxt.load(http://localhost/TESTER/data4flash.txt);
varsfromtxt.onLoad = function() {
//LoadVars values into text boxes
_root.myVar= varsfromtxt.myVar; 
_root.myfilename= varsfromtxt.myfilename;
}}

… I assumed that on each page load the flash would reload and retreive the updated data when called by my button event.

Appreciate any suggestions from the more knowledgable.
:beam:
Cheers

Paul