Código :
var posicionesX:Array = [38.9, 155.9, 278.9, 402.1, 527.1, 644.5, 36, 153, 276, 399.3, 524.3, 643.3, 34, 151, 274, 397.3, 522.3, 642.5, 31.3, 148.3, 271.3, 394.5, 519.5, 639.3, 83.7, 217.9, 328, 452.2, 586.4, 34, 151, 274, 397.3, 522.3, 644.5];
var posicionesY:Array = [54.2, 54.2, 54.2, 58.2, 58.2, 58.2, 180.4, 180.4, 180.4, 180.4, 180.4, 184.4, 306.4, 306.4, 306.4, 306.4, 306.4, 306.4, 422.6, 422.6, 422.6, 422.6, 422.6, 422.6, 422.6, 422.6, 510.6, 510.6, 510.6, 510.6, 510.6, 510.6, 630.6, 630.6, 630.6, 630.6, 630.6, 630.6];
//var id:Array=[1, 2, -1, 4, -1 ,5, 6 ,7, 8, 9, 10];
//var rotacion:Array = [0, 0];
var imagenes:Array = ["posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif", "posit.gif"];
for (var i:Number = 0; i<imagenes.length; i++) {
this.createEmptyMovieClip("clip"+i, this.getNextHighestDepth());
this["clip"+i]._x = posicionesX[i];
this["clip"+i]._y = posicionesY[i];
this["clip"+i].createEmptyMovieClip("contenedor", 6);
this["clip"+i].contenedor.loadMovie(imagenes[i]);
_root.createEmptyMovieClip("contenedor1", 1);
this["clip"+i].swf = "popup.swf";
this["clip"+i].onPress = function() {
_root.contenedor1.loadMovie(this.swf);
_root.contenedor1._x = 50;
_root.contenedor1._y = 100;
_root.contenedor1.swapDepths(_root.getNextHighestDepth());
//creamos la conexión
var enviar_lc:LocalConnection = new LocalConnection();
//la variable
var dato:Number = 1;
//enviamos los parámetros correctos, ya mencionados arriba.
enviar_lc.send("nombreCX", "metodo", dato);
};
}
Bien, cuando hacemos clik en uno de los postit se abre otro swf, este otro swf carga en dos campos una imagen y un texto que recoje de un xml...
Código :
System.useCodepage = true;
//creamos la variable de conexión donde recibiremos los datos
var recibir_lc:LocalConnection = new LocalConnection();
//en el método "metodo" se ejecutara con los parámetros que se envían
//desde el otro swf
_global.argum1=0;
recibir_lc.metodo = function(argum1:Number) {
argum1 = 1;
};
//hacemos la conexion.
recibir_lc.connect("nombreCX");
var mixml:XML = new XML();
mixml.ignoreWhite = true;
mixml.load("agenda.xml");
mixml.onLoad = function() {
trace(argum1);
foto = this.firstChild.childNodes[0].childNodes[argum1].attributes.foto;
texto = this.firstChild.childNodes[0].childNodes[1].attributes.cabecera;
_root.foto_mc.loadMovie(foto);
_root.foto_mc._yscale = 50;
_root.foto_mc._xscale = 50;
_root.mensaje_txt.setTextFormat(formato);
_root.mensaje_txt.text = texto;
};
La idea es de alguna forma saber en que postit a clikado, guardar una variable y enviarla al segundo swf, donde se colocara en la linea del xml para q cargue segun q imagen dependiendo del postit q se clike.
No se si se puede hacer... a ver si me pueden ayudar.
