Tengo en problema al realizar un onRelease a un texto dinámico y la verdad es que no se muy bien porque.
El caso es que el texto está vinculado a una imagen , ya que es una galería. Se carga mediante xml.
bueno, si pulso el número que se ha de quedar fijo, el onRelease funciona a modo de Rollover, es todo lo que he conseguido.
A ver si alguien me puede echar una manilla.
Código :
//instrucciones dinamicas
var meuXML:XML = new XML();
System.useCodepage = true;
meuXML.ignoreWhite = true;
_global.puxa = "meuMc";
_global.espacio = 8.3;
function Duplica(meuXML:XML):Void {
var menuBot:String = puxa;
var posX:Number = -29.5;
var posY:Number = 0;
var salto = 54;
for (var i = 0; i<meuXML.childNodes.length; i++) {
var titulo:String = (meuXML.childNodes[i].attributes.titulo);
var img:String = (meuXML.childNodes[i].attributes.img);
this.attachMovie(menuBot,puxa+i,i+28,5);
var item:Object = this[puxa+i];
item.titulo_txt.text = (titulo);
if (i<17) {// para que al cambiar de línea ponga los números donde debe
item._x = posX += (item._height)+espacio;
} else {
item._x = posX += (item._height)+espacio-salto*espacio;
salto = 0;
}
if (i<17) {// para cambiar de línea cuando haya mas de 16 fotos
item._y = posY;
} else {
item._y = posY+20;
}
item.guarda = img;
// cargar imagen inicialmente
var img_ini = (meuXML.childNodes[0].attributes.img);
_parent.mask.gotoAndPlay(2);
_parent.minhaImg = img_ini;
//RollOver
item.onRollOver = function() {
this.titulo_txt.textColor = "0x000000";
};
//RollOut
item.onRollOut = function() {
this.titulo_txt.textColor = "0x767376";
};
// cuando se presiona
item.onPress = function() {
_parent.conte_img.gotoAndPlay("desvanece");
this.titulo_txt.textColor = "0xC4C400";
_parent.mask.gotoAndPlay(2);
_parent.minhaImg = this.guarda;
};
}
}
meuXML.onLoad = function(ok) {
if (ok) {
Duplica(this);
}
};
_root.var_galery = 1;
switch (_root.var_galery) {// eleccion de la galeria
case 1 :
meuXML.load("xml/galery_hotel.xml");
break;
}en el _parent.mask.gotoAndPlay(2); tengo puesto este código.
Código :
this._parent.conte_img.img.loadMovie(_parent.minhaImg);// carga imagenes en números
stop();
this.onEnterFrame = function() {// Esto carga las sucesivas imagenes
if (_parent.conte_img.img._framesloaded>=_parent.conte_img.img._totalframes) {
_parent.conte_img.gotoAndPlay(1);
_parent.mask.reverseMovieClip();
}
}; 