Comunidad de diseño web y desarrollo en internet online

Abrir imágenes en popup desde un XML

Citar            
MensajeEscrito el 08 Jul 2005 02:19 am
Hola, les cuento que tengo un problemilla, tengo una seccion de noticias (con un componente scroll), que son tomadas desde un XML, este XML es carga texto e imagenes.

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... :crap:



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 

Por RaMMa

6 de clabLevel



 

msie
Citar            
MensajeEscrito el 08 Jul 2005 02:47 am
y vuelve y juega, porfavor noooooooooo noooo usen popup´s por que es un fastidio para el usuario, lo primero para un desarrollador web, es pensar como usuario y lo que le molestaria encontrar, ademas ahora muchos por no decir todos los ultimos antivirus traen bloqueo de popup´s inclusive si utilizan firefox se las bloquea automatico y entonces :? :?
por favor no usen eso, es peor que el spam :evil: :evil:

Por hackjasl

72 de clabLevel



 

firefox
Citar            
MensajeEscrito el 08 Jul 2005 04:34 am

hackjasl escribió:

....bloqueo de popup´s inclusive si utilizan firefox se las bloquea automatico....


Se bloquean solo las no solicitadas, si tienes un link, o boton que abre un pop up, nadie lo va a detener.
No me molestan tanto si yo las llamo, como en muchas galerias de imagenes, es mucho mas facil hacerlas asi que de otra forma, mas si es en flash.

Por Ramm

BOFH

3152 de clabLevel

6 tutoriales
8 articulos

Genero:Masculino   Bastard Operators From Hell REC Héroes

London, UK

clabbrowser
Citar            
MensajeEscrito el 08 Jul 2005 04:56 am
Concuerdo con lo que dice ramm, si yo pido el popup´s es porque estoy consciente de ello.

Se juega con el usuario es cuando le cargas información que él no ha solicitado, la mala fama de los popup´s es por el mal uso que le han dado desde hace mucho tiempo. :wink:

Por Maikel

BOFH

5575 de clabLevel

22 tutoriales
5 articulos

Genero:Masculino   Team Cristalab

Claber de baja indefinida

firefox
Citar            
MensajeEscrito el 09 Jul 2005 04:59 am
si no estoy mal un popup es una ventana para mostrar informacion adicional, pero la cual nunca ha tomado en cuenta si el usuario la quiere abris, sino que ella lo hacer por defecto, en cambio si el usuario presiona un boton es por que esta aceptando abrir otra ventana asi no tenga menubar o status, es una ventana mas, pero no un popup, te recomendaria mas vien ventanas flotantes en flash, claro, pero siempre preguntandole al usuario si decea aceptarla y si le interesa ver su contenido... :wink:

Por hackjasl

72 de clabLevel



 

firefox
Citar            
MensajeEscrito el 12 Jul 2005 05:43 pm
Otra alternativa seria hacer la imagen mas grande con algun clip extra. Funcionaria ?

Por Jorgelig

Claber

3035 de clabLevel

12 tutoriales

 

Monterrey, Nuevo Leon, MX

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.