Comunidad de diseño web y desarrollo en internet online

Carga de imagen en flash a traves de xml.. me apoyan?

Citar            
MensajeEscrito el 18 Ago 2008 04:09 pm
Hola a todos, tengo un pequeño problemita con un codigo... les comento:
Tengo un componente que compre el cual carga las imagenes desde una carpeta especifica a traves de un XML.

Este flash es un banner que rota imagenes y conjuntamente su titulo y descripcion con el pasar del maus. He agregado algunas lineas al codigo AS y tambien al XML con el objetio de personalizar mas dicho flash.
Lo que quiero hacer ahora es aumentar un pequeño icono que cuando cambie de imagen (conjuntamente cambia el texto titulo y descripcion) tambien lo haga el icono (como haciendo referencia de que se trata dicha imagen).
Espero haber sido lo suficientemente claro con mi explicacion.

Miren, les pongo el xml :

Código :

<gallery
base = ""
background = "#FFFFFF"
banner = "#F0F0F0"
text = "#000000"
link = "#0000FF"
alink = "#FF0000"
vlink = "#800080"
date = "24/8/2007">
   <sitename>Adobe Web Photo Gallery</sitename>
   <photographer></photographer>
   <contactinfo></contactinfo>
   <email></email>
   <security><![CDATA[]]> </security>

<banner font = "Arial" fontsize = "3" color =  "#F0F0F0"> </banner>
<thumbnail base ="thumbnails/" font = "Arial" fontsize = "4" color = "#F0F0F0" border = "0" rows = "3" col = "5" valing="middle"> </thumbnail> 
<large base ="images/" font = "Arial" fontsize = "3" color = "#F0F0F0" border = "0"> </large>
<images id = "images">

<image

path = "0.jpg"
width = "350"

height = "350"

thumbpath = "0.jpg"

thumbwidth = "200"

thumbheight = "200">

<meta name = "title"><![CDATA[<b>Melgar derrota al Bolognesi</b> con gol de Sergio Ibarra 14/08/2008]]></meta>

<!-- Titulo de tipo de archivo -->
<meta name = "title_sup"><![CDATA[<b>AUDIO</b> ]]></meta>
<!-- fin -->
<meta name = "link"><![CDATA[http://www.abc.com]]></meta>

<meta name = "linktarget"><![CDATA[http://www.abc.com]]></meta>
<!-- icono que quiero que rote en conjuto con lo demas -->
<meta name = "icon"><![CDATA[2_.jpg]]></meta>
<!-- fin -->
</image>


<image
path = "1.jpg"
width = "350"
height = "350"
thumbpath = "1.jpg"
thumbwidth = "200"
thumbheight = "200">
<meta name = "title"><![CDATA[<b>Construcciòn de la Presa Limon del Proyecto Olmos</b>. Foto: ANDINA /Carlos Lezama. 13/08/2008]]></meta>
<!-- Titulo de tipo de archivo -->
<meta name = "title_sup"><![CDATA[<b>AUDIO</b> ]]></meta>
<!-- fin -->
<meta name = "link"><![CDATA[http://www.abc.com]]></meta>

<meta name = "linktarget"><![CDATA[http://www.abc.com]]></meta>

</image>

<image
path = "2.jpg"
width = "350"
height = "350"
thumbpath = "2.jpg"
thumbwidth = "200"
thumbheight = "200">
<meta name = "title"><![CDATA[<b>Tala indiscriminada</b> de bosques secos de Mórrope. Foto: ANDINA / Gobierno regional de Lambayeque. 13/08/2008]]></meta>
<!-- Titulo de tipo de archivo -->
<meta name = "title_sup"><![CDATA[<b>VIDEO</b> ]]></meta>
<!-- fin -->
<meta name = "link"><![CDATA[http://www.abc.com]]></meta>

<meta name = "linktarget"><![CDATA[http://www.abc.com]]></meta>

</image>


<image
path = "3.jpg"
width = "350"
height = "350"
thumbpath = "3.jpg"
thumbwidth = "200"
thumbheight = "200">
<meta name = "title"><![CDATA[<b>Ministro de Energía y Minas</b>, Juan Valdivia, y presidente regional de Loreto, Yván Vásquez, tras suscribir convenio marco 

para electrificar comunidades en extrema pobreza. Foto: ANDINA / MEM. 13/08/2008 ]]></meta>
<!-- Titulo de tipo de archivo -->
<meta name = "title_sup"><![CDATA[<b>FOTOGRAFÍA</b> ]]></meta>
<!-- fin -->
<meta name = "link"><![CDATA[http://www.abc.com]]></meta>

<meta name = "linktarget"><![CDATA[http://www.abc.com]]></meta>

</image>


<image
path = "4.jpg"
width = "350"
height = "350"
thumbpath = "4.jpg"
thumbwidth = "200"
thumbheight = "200">
<meta name = "title"><![CDATA[<b>Enrique Gubbins</b>, gerente general de SDF Energía, presentó a la prensa la primera planta de cogeneración de energía 

eléctrica en el Perú. Foto : ANDINA / Jorge Paz H 13/08/2008]]></meta>
<!-- Titulo de tipo de archivo -->
<meta name = "title_sup"><![CDATA[<b>VIDEO</b> ]]></meta>
<!-- fin -->
<meta name = "link"><![CDATA[http://www.abc.com]]></meta>

<meta name = "linktarget"><![CDATA[http://www.abc.com]]></meta>

</image>


<image
path = "5.jpg"
width = "350"
height = "350"
thumbpath = "5.jpg"
thumbwidth = "200"
thumbheight = "200">
<meta name = "title"><![CDATA[<b>Declaraciones del Ministro de Defensa</b>, Antero Flores, tras participar en consejo de ministros.Foto:SEPRES/OscarFarje 

Gomero 13/08/2008 ]]></meta>
<!-- Titulo de tipo de archivo -->
<meta name = "title_sup"><![CDATA[<b>VIDEO</b> ]]></meta>
<!-- fin -->
<meta name = "link"><![CDATA[http://www.abc.com]]></meta>

<meta name = "linktarget"><![CDATA[http://www.abc.com]]></meta>

</image>


<image
path = "6.jpg"
width = "318"
height = "350"
thumbpath = "6.jpg"
thumbwidth = "181"
thumbheight = "200">
<meta name = "title"><![CDATA[<b>La esposa del Presidente de la República</b>, inauguró la II Convención Nacional de la Familia: “Las familias, como eje 

estratégico para la inclusión y desarrollo”.Foto:ANDINA/Norman Cordova 13/08/2008 ]]></meta>
<!-- Titulo de tipo de archivo -->
<meta name = "title_sup"><![CDATA[<b>MULTIMEDIA</b> ]]></meta>
<!-- fin -->
<meta name = "link"><![CDATA[http://www.abc.com]]></meta>

<meta name = "linktarget"><![CDATA[http://www.abc.com]]></meta>

</image>


<image
path = "7.jpg"
width = "350"
height = "350"
thumbpath = "7.jpg"
thumbwidth = "200"
thumbheight = "200">
<meta name = "title"><![CDATA[<b>Por segundo día consecutivo</b>, el presidente Alan García visitó Pisco y Chincha para inspeccionar el avance de las obras 

que se realizan en las zonas afectadas por el terremoto. 13/08/2008 ]]></meta>
<!-- Titulo de tipo de archivo -->
<meta name = "title_sup"><![CDATA[<b>VIDEO</b> ]]></meta>
<!-- fin -->
<meta name = "link"><![CDATA[http://www.abc.com]]></meta>

<meta name = "linktarget"><![CDATA[http://www.abc.com]]></meta>

</image>


<image
path = "8.jpg"
width = "350"
height = "350"
thumbpath = "8.jpg"
thumbwidth = "200"
thumbheight = "200">
<meta name = "title"><![CDATA[<b>El presidente Alan García visitó Pisco y Chincha</b> para inspeccionar el avance de las obras que se realizan en las zonas 

afectadas por el terremoto. Foto: ANDINA /Sepres/ Oscar Farje. 13/08/2008 ]]></meta>
<!-- Titulo de tipo de archivo -->
<meta name = "title_sup"><![CDATA[<b>FOTOGRAFÍA</b> ]]></meta>
<!-- fin -->
<meta name = "link"><![CDATA[http://www.abc.com]]></meta>

<meta name = "linktarget"><![CDATA[http://www.abc.com]]></meta>

</image>


<image
path = "9.jpg"
width = "350"
height = "350"
thumbpath = "9.jpg"
thumbwidth = "200"
thumbheight = "200">
<meta name = "title"><![CDATA[<b>La cantante Damaris en ceremonia por el Dia Internacional de la Juventud</b> en Palacio de Gobierno. Foto: ANDINA/ Vidal 

Tarqui 12/08/2008 ]]></meta>
<!-- Titulo de tipo de archivo -->
<meta name = "title_sup"><![CDATA[<b>MULTIMEDIA</b> ]]></meta>
<!-- fin -->
<meta name = "link"><![CDATA[http://www.abc.com]]></meta>

<meta name = "linktarget"><![CDATA[http://www.abc.com]]></meta>

</image>

<image
path = "10.jpg"
width = "350"
height = "350"
thumbpath = "10.jpg"
thumbwidth = "200"
thumbheight = "200">
<meta name = "title"><![CDATA[<b>Mig 29 de la Fuerza Aérea del Perú</b>. 12/08/2008 ]]></meta>
<!-- Titulo de tipo de archivo -->
<meta name = "title_sup"><![CDATA[<b>VIDEO</b> ]]></meta>
<!-- fin -->
<meta name = "link"><![CDATA[http://www.abc.com]]></meta>

<meta name = "linktarget"><![CDATA[http://www.abc.com]]></meta>

</image>


<image
path = "11.jpg"
width = "350"
height = "350"
thumbpath = "11.jpg"
thumbwidth = "200"
thumbheight = "200">
<meta name = "title"><![CDATA[<b>Ministro del interior,Luis Alva Castro</b>,entrega patrulleros y motocicletas y presenta a los cien nuevos policias que 

prestaran seguridad a la ciudad de pisco. Foto:ANDINA/Jack Ramón Morales 11/08/2008 ]]></meta>
<!-- Titulo de tipo de archivo -->
<meta name = "title_sup"><![CDATA[<b>AUDIO</b> ]]></meta>
<!-- fin -->
<meta name = "link"><![CDATA[http://www.abc.com]]></meta>

<meta name = "linktarget"><![CDATA[http://www.abc.com]]></meta>

</image>


<image
path = "12.jpg"
width = "234"
height = "350"
thumbpath = "12.jpg"
thumbwidth = "133"
thumbheight = "200">
<meta name = "title"><![CDATA[<b>Municipalidad de Miraflores</b> dona a Compañia de Bomberos Miraflores 28, moderna y equipada autobomba. Foto: ANDINA/Rafael 

Cornejo 11/08/2008 ]]></meta>
<!-- Titulo de tipo de archivo -->
<meta name = "title_sup"><![CDATA[<b>FOTOGRAFÍA</b> ]]></meta>
<!-- fin -->
<meta name = "link"><![CDATA[http://www.abc.com]]></meta>

<meta name = "linktarget"><![CDATA[http://www.abc.com]]></meta>

</image>


<image
path = "13.jpg"
width = "350"
height = "350"
thumbpath = "13.jpg"
thumbwidth = "200"
thumbheight = "200">
<meta name = "title"><![CDATA[<b>Director de cine, Alex Rivero</b>. Foto: ANDINA/Rubén Grández 10/08/2008 ]]></meta>
<!-- Titulo de tipo de archivo -->
<meta name = "title_sup"><![CDATA[<b>VIDEO</b> ]]></meta>
<!-- fin -->
<meta name = "link"><![CDATA[http://www.abc.com]]></meta>

<meta name = "linktarget"><![CDATA[http://www.abc.com]]></meta>

</image>


<image
path = "14.jpg"
width = "260"
height = "350"
thumbpath = "14.jpg"
thumbwidth = "148"
thumbheight = "200">
<meta name = "title"><![CDATA[<b>Presidente del Congreso</b> se presentò esta mañana en RPP. Foto:ANDINA/Hector Vinces. 10/08/2008 ]]></meta>
<!-- Titulo de tipo de archivo -->
<meta name = "title_sup"><![CDATA[<b>MULTIMEDIA</b> ]]></meta>
<!-- fin -->
<meta name = "link"><![CDATA[http://www.abc.com]]></meta>

<meta name = "linktarget"><![CDATA[http://www.abc.com]]></meta>

</image>
</images>
</gallery>


Y el AS es:

Código :

//import event
import com.digicrafts.events.*;

//add click action to the photoflip
photoflip.addEventListener(ItemEvent.CLICK, iEventHandler);
photoflip.addEventListener(ItemEvent.CHANGE, iEventHandler);

photoflip.addEventListener(ItemEvent.CLICK, iEventHandler2);
photoflip.addEventListener(ItemEvent.CHANGE, iEventHandler2);

/*
photoflip.addEventListener(ItemEvent.DOUBLE_CLICK, iEventHandler);
photoflip.addEventListener(ItemEvent.MOUSE_OVER, iEventHandler);
photoflip.addEventListener(ItemEvent.MOUSE_OUT, iEventHandler);
photoflip.addEventListener(ItemEvent.SELECT, iEventHandler);
*/

//aqui trato de llamar al icono en mencion, pero no resulta
function eventHandler3(event:Object) {
   // load a icon image into icon_mc
   icon_mc.loadMovie(event.target.item.icon);
}


function iEventHandler2(event:ItemEvent) {
   switch (event.type) {
         //Event when selection change
      case ItemEvent.CHANGE :
         //change the caption to filename
         caption2.htmlText = event.item.title_sup;
         //Event when click on the item
      case ItemEvent.CLICK :
         break;
      default :
         break;
   }
}

function iEventHandler(event:ItemEvent) {
   switch (event.type) {
         //Event when selection change
      case ItemEvent.CHANGE :
         //change the caption to filename
         caption.htmlText = event.item.title;
         //Event when click on the item
      case ItemEvent.CLICK :
         break;
      default :
         break;
   }
}


Espero que puedan ayudarme, les agradesco mucho

Por julfit0

45 de clabLevel



 

msie7
Citar            
MensajeEscrito el 18 Ago 2008 05:16 pm
Tu código está en AS3 y estás tratando de leer el ícono con AS2, este no es todo el código, sin ver como es que se lee el XML y donde crea los elementos es muy difícil guiarte, pero por lo pronto debes postear en el foro de AS3.

Por elchininet

Claber

3921 de clabLevel

17 tutoriales

Genero:Masculino  

Front-end developer at Booking.com

firefox
Citar            
MensajeEscrito el 18 Ago 2008 05:19 pm
Maestro!... pucha, habia olvidado decir que es en AS3, de todos modos muchas gracias por el interes de siempre ^^

Por julfit0

45 de clabLevel



 

msie7

 

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