Mi consulta es la siguiente, como puedo añadir al XML el link para que cuando haga click en las imagenes del XML me abra esa imagen en un popup.
Aqui les poste el codigo.. Muchas gracias!!! ( NO pretendo ke lo lean todo pero es para orientarse nomas... por las dudas) Como yo mucho no entiendo...
Código :
#initclip
function newsBlock() {
_global.ref = this;
this.init();
}
newsBlock.prototype = new MovieClip();
Object.registerClass("newsBlock",newsBlock);
// init
newsBlock.prototype.init = function() {
ref._x = Math.round(ref._x);
ref._y = Math.round(ref._y);
ref.componentWidth = ref._width;
ref.componentHeight = ref._height;
ref._xscale = ref._yscale=100;
ref.boundingBox_mc._visible = false;
ref.add_borders();
ref.attachMovie("textBlock_mc","textBlock_mc",5)
ref.textBlock_mc.news_txt.html=true
ref.textBlock_mc.news_txt.selectable=ref.t_select
ref.textBlock_mc.news_txt.textColor=this.t_color.toString(16)
ref.textBlock_mc.news_txt.text = "loading XML data";
ref.setSize(ref.componentWidth, ref.componentHeight);
//
//----------
var newsXML = new XML(this);
newsXML.ignoreWhite = true;
newsXML.onLoad = function(success) {
if (success) {
if (this.loaded && this.hasChildNodes) {
ref.news_content = new Array();
//Nuevo para meter imagenes
ref.news_img = new Array();
ref.news_date = new Array();
if (this.firstChild.nodeName.toLowerCase() == "newsblock") {
var nm = this.firstChild.childNodes;
for (var i = 0; i<=nm.length; i++) {
if (nm[i].nodeName == "news") {
ref.news_date.push(nm[i].attributes.date);
//Nuevo para meter imagenes
ref.news_img.push(nm[i].attributes.img);
ref.news_content.push(nm[i].firstChild.nodeValue);
}
}
}
}
ref.show_news2();
}
};
newsXML.load("prensa.xml");
};
newsBlock.prototype.add_borders = function() {
this.attachMovie("border_up", "border_up", 1);
this.attachMovie("border_down", "border_down", 2);
this.attachMovie("border_left", "border_left", 3);
this.attachMovie("border_right", "border_right", 4);
};
newsBlock.prototype.show_news = function(n) {
trace(ref.news_img[n]);
//Nuevo para meter imagenes
//ref.textBlock_mc.news_txt.htmlText = "<FONT COLOR='#"+ref.d_color.toString(16)+"'>"+ref.news_date[n]+"</FONT>"+"<br>"+"<FONT COLOR='#"+ref.t_color.toString(16)+"'>"+ref.news_content[n]+"</FONT>" +"<br><A HREF=\"asfunction:ref.show_news2,"+i+"\"><FONT COLOR='#"+ref.l_color.toString(16)+"'><u>Volver al Indice</u></FONT></A><br>";
ref.textBlock_mc.news_txt.htmlText = "<img src='" + ref.news_img[n] + "' width='220' height='76'>" + "<br><br><br><br><br><br><br><br>" + "<FONT COLOR='#"+ref.d_color.toString(16)+"'><b>- FECHA: "+ref.news_date[n]+"</b></FONT>"+"<br>"+" <FONT COLOR='#"+ref.t_color.toString(16)+"'>"+ref.news_content[n]+"</FONT>" +"<br><A HREF=\"asfunction:ref.show_news2,"+i+"\"><FONT COLOR='#"+ref.l_color.toString(16)+"'><u>Volver al Indice</u></FONT></A><br>";
};
newsBlock.prototype.show_news2 = function() {
var cnt = ref.news_content.length;
ref.textBlock_mc.news_txt.text = "";
if(!ref.sf_news){
for (var i = 0; i<cnt; i++) {
//Nuevo para meter imagenes
//ref.textBlock_mc.news_txt.htmlText += + "<FONT COLOR='#"+ref.d_color.toString(16)+"'>"+ref.news_date[i]+"</FONT>"+"<br>"+"<FONT COLOR='#"+ref.t_color.toString(16)+"'>"+ref.news_content[i].substring(0, ref.n_symbol)+"</FONT>"+"...<br><A HREF=\"asfunction:ref.show_news,"+i+"\"><FONT COLOR='#"+ref.l_color.toString(16)+"'>"+"<u>Leer Noticia</u></FONT></A><br>";
ref.textBlock_mc.news_txt.htmlText += "<img src='" + ref.news_img[i] + "' width='220' height='76'>" + "<br><br><br><br><br><br><br><br>" + "<FONT COLOR='#"+ref.d_color.toString(16)+"'><b>- FECHA: "+ref.news_date[i]+"</b></FONT>"+"<br>"+" <FONT COLOR='#"+ref.t_color.toString(16)+"'>"+ref.news_content[i].substring(0, ref.n_symbol)+"</FONT>"+"...<br><A HREF=\"asfunction:ref.show_news,"+i+"\"><FONT COLOR='#"+ref.l_color.toString(16)+"'>"+"<u>Leer Noticia</u></FONT></A><br>";
}
}else{
for (var i = 0; i<cnt; i++) {
//Nuevo para meter imagenes
//ref.textBlock_mc.news_txt.htmlText += "<FONT COLOR='#"+ref.d_color.toString(16)+"'>"+ref.news_date[i]+"</FONT>"+"<br>"+"<FONT COLOR='#"+ref.t_color.toString(16)+"'>"+ref.news_content[i]+"<br><br>";
ref.textBlock_mc.news_txt.htmlText += "<img src='" + ref.news_img[i] + "' width='220' height='76'>" + "<br><br><br><br><br><br><br><br>" + "<FONT COLOR='#"+ref.d_color.toString(16)+"'><b>- FECHA: "+ref.news_date[i]+"</b></FONT>"+"<br>"+" <FONT COLOR='#"+ref.t_color.toString(16)+"'>"+ref.news_content[i]+"<br>";
}
}
};
// setSize
newsBlock.prototype.setSize = function(w, h) {
this.componentWidth = Math.round(w);
this.componentHeight = Math.round(h);
this.boundingBox_mc._width = Math.round(w);
this.boundingBox_mc._height = Math.round(h);
var tmp = 4;
this.border_up._x = 0;
this.border_up._y = 0;
this.border_up._width = this.boundingBox_mc._width-tmp-16;
this.border_left._x = 0;
this.border_left._y = this.border_up._height;
this.border_left._height = this.boundingBox_mc._height-this.border_up._height-this.border_down._height;
this.border_down._x = 0;
this.border_down._y = this.border_up._height+this.border_left._height;
this.border_down._width = this.border_up._width;
this.border_right._x = this.border_up._width-this.border_right._width;
this.border_right._y = this.border_up._height;
this.border_right._height = this.border_left._height;
this.textBlock_mc.news_txt._x = this.border_left._width;
this.textBlock_mc.news_txt._y = this.border_up._height;
this.textBlock_mc.news_txt._width = this.border_up._width-this.border_left._width-this.border_right._width
this.textBlock_mc.news_txt._height = this.border_left._height-this.border_up._height-this.border_down._height
};
#endinitclip
