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

**URL:** https://forum.kirupa.com/t/loading-vars-problem-yes-i-checked-the-resources/68023
**Category:** Uncategorized
**Created:** [October 21, 2004, 11:58am UTC](https://forum.kirupa.com/t/loading-vars-problem-yes-i-checked-the-resources/68023 "2004-10-21T11:58:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![2nd\_day](https://avatars.discourse-cdn.com/v4/letter/2/a4c791/32.png) [@2nd\_day](https://forum.kirupa.com/u/2nd_day)
#### Post date: [October 21, 2004, 11:58am UTC](https://forum.kirupa.com/t/loading-vars-problem-yes-i-checked-the-resources/68023/1 "2004-10-21T11:58:53Z")

</div>

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

```auto

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
 
<?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
