# Variable value not passing to clipEvent

**URL:** <https://forum.kirupa.com/t/variable-value-not-passing-to-clipevent/173808>\
**Category:** Uncategorized\
**Created:** [December 29, 2005, 10:53pm UTC](https://forum.kirupa.com/t/variable-value-not-passing-to-clipevent/173808 "2005-12-29T22:53:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![onsitus](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/onsitus/32/971_2.png) [@onsitus](https://forum.kirupa.com/u/onsitus)\
**Post date:** [December 29, 2005, 10:53pm UTC](https://forum.kirupa.com/t/variable-value-not-passing-to-clipevent/173808/1 "2005-12-29T22:53:46Z")

</div>

Frame1:

```auto
stop();
loadText = new LoadVars();
loadText.load("gallery.txt");
loadText.onLoad = function(success) {
 _global.total = this.total;
 trace(_global.total);
 gotoAndStop(2);
};

```

Frame2:

```auto
stop();
MovieClip.prototype.tot = total;
MovieClip.prototype.i = tot/2;
MovieClip.prototype.j = i;
MovieClip.prototype.num = tot;

```

Attached on a mc (within a mc):

```auto
onClipEvent (load) {
 this._visible = 0;
}
onClipEvent (enterFrame) {
 //CODE GENERAZIONE QUARDATI
 trace(tot);
 for (var i = 1; i<tot+1; i++) {
  e = "foto"+i;
  if (i%2 != 0) {
   if (i != 1 && i != 2) {
    yp = 0;
    xp = _parent["foto"+String(i-2)]._x+68;
   } else {
    xp = 0;
    yp = 0;
   }
  } else {
   if (i != 1 && i != 2) {
    yp = 68;
    xp = _parent["foto"+String(i-2)]._x+68;
   } else {
    yp = 68;
    xp = 0;
   }
  }
  duplicateMovieClip(_parent.foto, e, i);
  _parent[e]._x = xp;
  _parent[e]._y = yp;
  _parent[e].img._xscale = 64;
  _parent[e].img._yscale = 64;
  _parent[e].foto.n.text = i;
  _parent[e].dataa = dataa*;
  _parent[e].link = link*;
 }
}

```

What it does (should do) basicaly is duplicate the mc foto for the value of tot.  
The txt file is loaded properly and it does trace the correct value for total and tot but it doesn’t duplicate the movie.  
If instead of

```auto
MovieClip.prototype.tot = total;

```

I write

```auto
MovieClip.prototype.tot = 10;

```

Everything works fine.  
Any idea why if tot and total trace the right value, the duplicateMovieClip won’t work???:-/
