Loading vars problem (yes i checked the resources..)

i’ve got a problem, and i really don’t know what i do wrong… so maybe you could help me out. this is my flas code


loadText = new LoadVars();
loadText.load("source/read.php");
loadText.onLoad = function() {
 total = this.g;
 //total = 4;
 for(i = 1; i < total+1; i++){
  _root["boe"+i] = this["gal"+i];
 }
 for(b = 1; b < total+1; b++){
  attachMovie(1, b, b);
  _root**._y = (81.3 + (18.5*b));
  _root**.naam = _root["boe"+i];
 }
};

the problem is that when i use total=4 it works… it attaches the movieclip 4 times… but when i use total=this.g it doesnt attach… but a textfield with the vars total does says 4 (so that is correct)… i dont get it…
in case you need it, here’s my php code:

 
<?php

$i = 0;

if ($handle = opendir('.')) {

while (false !== ($file = readdir($handle))) {



if ($file != "." && $file != ".." && $file != "read.php") {

$i = $i + 1;

echo "&gal$i=$file
";

} 

} 

closedir($handle);

$total = $i;

echo "&g=$total";

} 

?> 

 

thanks for reading