gracias!!!!
aqui esta el codigo
class Galeria {
//Propiedades
private var que:String;
private var width:Number;
private var height:Number;
private var thumbContainer_mc:MovieClip;
private var imageContainer_mc:MovieClip;
private var target_mc:MovieClip;
private var thumbs:Array = new Array();
private var images:Array = new Array();
private var tLoader:MovieClipLoader;
//constructor
public function Galeria(target:MovieClip, numero:Number, x:Number, y:Number, w:Number, h:Number) {
tLoader = new MovieClipLoader();
target_mc = target;
tLoader.addListener(this);
creaGaleria(numero, x, y, w, h);
}
private function creaGaleria(numero:Number, depth:Number, x:Number, y:Number, w:Number, h:Number):Void {
var n:Number
for (var depth = 0; depth<numero; depth++) {
thumbContainer_mc.n=depth //////CREO UNA VARIABLE N
///aqui llenamos los arrays
images[depth] = ("foto"+depth+".jpg");
thumbs[depth] = ("thumb"+depth+".jpg");
trace(thumbs[depth]);
///y asignamos dinamicamente un mc de la libreria
thumbContainer_mc = target_mc.attachMovie("cub", "cube"+depth, depth);
thumbContainer_mc._width = w;
thumbContainer_mc._height = h;
thumbContainer_mc._x = x;
thumbContainer_mc._y += 120*depth;
///cargamos los mc con los thumbnails
tLoader.loadClip(images[depth],thumbContainer_mc)
}
}
public function onLoadComplete(target:MovieClip):Void {
target.onRollOver = function() {
this._alpha = 60;
};
target.onRollOut = function() {
this._alpha = 100;
};
target.onRelease = function() {
trace(this.n)///////////////AQUI SALE UNDEFINED
carga(this.n)
};
}
private function carga(que:String):Void {
imageContainer_mc = target_mc.createEmptyMovieClip("contenedor_mc", 100);
imageContainer_mc._x = 300;
imageContainer_mc.loadMovie(que)
}
}