# Load variables and duplicating movies

**URL:** <https://forum.kirupa.com/t/load-variables-and-duplicating-movies/48722>\
**Category:** flash\
**Created:** [April 16, 2004, 6:01am UTC](https://forum.kirupa.com/t/load-variables-and-duplicating-movies/48722 "2004-04-16T06:01:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![theguaz](https://avatars.discourse-cdn.com/v4/letter/t/eada6e/32.png) [@theguaz](https://forum.kirupa.com/u/theguaz)\
**Post date:** [April 16, 2004, 6:01am UTC](https://forum.kirupa.com/t/load-variables-and-duplicating-movies/48722/1 "2004-04-16T06:01:11Z")

</div>

i have a movieclip called N inside a movieclip in the main timeline.  
I will load the “Total” variable from a PHp but until then i use a txt with Total=23; this will make 23 copies of the N movie clip.(when i use PHP that number can be any number).

and in this timeline i have this code:

```auto

[COLOR=Red]//carga de la variable[/COLOR]
myVars = new LoadVars();
myVars.load("files.txt");
myVars.onLoad = function() {
	chucheta = this.Total;
	trace(chucheta);
};
[COLOR=Red]//la multiplicacion de las movies[/COLOR]
for (count=0; count<chucheta; count++) {
	this.N.duplicateMovieClip("N"+count, count);
	this["N"+count].numero.htmlText = count+1;
	this["N"+count]._x = -300+(this["N"+count]._width+1)*count;
}
[COLOR=Red]//carga primera foto y borrado de la movieclip original
//this.Photo.loadMovie("imagenes/1.jpg");[/COLOR]
this.N._y = -1500;
this.N._alpha = 0;

```

if i replace the “chucheta” variable with a number works fine but when i try to use the variable “chucheta” to replicate the movie nothing works.  
It seem to blank the variable outside the function  
PD this movie it gonna load in a main movie with myMC.loadMovie();  
Also i attached the fla file

theguaz
