Bueno
Tengo un serio problema.
Estoy haciendo un juego en flash,
y necesito poner dos movieclips, y uno asignarlo como máscara.
Hice un programita en modo de ejemplo.
Tengo un movieclip llamado a, y otro movieclip llamado d, ambos linkeados.
El código es el siguiente:
aa1 = new Array();
aa2 = new Array();
i=0;
_root.createEmptyMovieClip("a1", _root.getNextHighestDepth());
_root.createEmptyMovieClip("a2", _root.getNextHighestDepth());
for (i=1; i<3; i++){
aa1[i]= a1.attachMovie("a", "a", a1.getNextHighestDepth(), {_x:0+(i*100), _y:0+(i*100)});
aa2[i]= a2.attachMovie("d", "d", a2.getNextHighestDepth(), {_x:0+(i*100), _y:0+(i*100)});
aa1[i].setMask(aa2[i]);
}
Entonces vamos a ver como funciona ésto:
Hacemos un Debug y acá van los pasos bien detallados.
1:
aa1= a1.attachMovie("a", "a", a1.getNextHighestDepth(), {_x:0+(i*100), _y:0+(i*100)});
i = 1
en aa1[1] se dibuja el clip a
(http://i25.tinypic.com/30i8781.jpg)
2:
aa2= a2.attachMovie("d", "d", a2.getNextHighestDepth(), {_x:0+(i*100), _y:0+(i*100)});
i = 1
en aa2[1] se dibuja el clip d
(http://i27.tinypic.com/15yckkz.jpg)
3:
aa1.setMask(aa2);
se asigna la mascara
(http://i32.tinypic.com/nbzmh5.jpg)
4:
aa1= a1.attachMovie("a", "a", a1.getNextHighestDepth(), {_x:0+(i*100), _y:0+(i*100)});
i = 2
en aa1[2] se dibuja el clip a
(http://i25.tinypic.com/2rmvz15.jpg)
5:
aa2= a2.attachMovie("d", "d", a2.getNextHighestDepth(), {_x:0+(i*100), _y:0+(i*100)});
i = 2
en aa2[2] se dibuja el clip d
(http://i28.tinypic.com/2z5192e.jpg)
6:
WTF ?????
(http://i31.tinypic.com/2ibl2pv.jpg)
cuando se asigna la mascara queda así (?) chan.
y tendría que quedar algo así
(http://i30.tinypic.com/r1ikrb.jpg)
¿Alguien sabe por que pasa ésto?
Muchas Gracias de Antemano