Foros del Web » Creando para Internet » Flash y Actionscript »

Cómo poner solo los títulos ?

Estas en el tema de Cómo poner solo los títulos ? en el foro de Flash y Actionscript en Foros del Web. Estoy tratando de modificar un AS que encontre para poner noticias desde un XML con flash. Lo que estoy buscando es que me ponga sólo ...
  #1 (permalink)  
Antiguo 02/12/2009, 19:46
Avatar de AJVEvoluzione  
Fecha de Ingreso: agosto-2004
Ubicación: Buenos Aires
Mensajes: 195
Antigüedad: 19 años, 7 meses
Puntos: 1
Exclamación Cómo poner solo los títulos ?

Estoy tratando de modificar un AS que encontre para poner noticias desde un XML con flash.
Lo que estoy buscando es que me ponga sólo el "titulo" (de cada noticia en el scroll de texto), ya que tiene un boton para poder verlas enteras, pero ya estuve viendolo y no pude, si alguien me da una mano

AS

Código PHP:
System.useCodepage true
var 
indice:Number
var 
noticias_xml:XML

function 
cargarDatos(_indice:Number){
        var 
fecha:String;
        var 
titulo:String;
        var 
mensaje:String;
        var 
imagen:String;
        
fecha noticias_xml.firstChild.childNodes[_indice].attributes.fecha;
        
titulo noticias_xml.firstChild.childNodes[_indice].firstChild.firstChild.nodeValue;
        
mensaje noticias_xml.firstChild.childNodes[_indice].firstChild.nextSibling.firstChild.nodeValue
        imagen 
noticias_xml.firstChild.childNodes[_indice].lastChild.firstChild.nodeValue
    ScrollBar
.setScrollTarget(mensaje_txt);
    
formStyleFormat             = new FStyleFormat;

        
formStyleFormat.scrollTrack "0xFFFFFF";
        
formStyleFormat.highlight   "0xFFFFFF";
        
formStyleFormat.highlight3D "0x6178EC";
        
formStyleFormat.arrow         "0x000099";
        
formStyleFormat.face         "0xAAAAAA";
        
formStyleFormat.background  "0x000000";
        
formStyleFormat.shadow        "0x6178EC";
        
formStyleFormat.darkshadow    "0x777777";
        
    
formStyleFormat.addListener(ScrollBar);
    
formStyleFormat.applyChanges();
        
_root.mensaje_txt.htmlText "";
        
_root.mensaje_txt.htmlText += "<p><font color='#33CC00' size='15'><b>" titulo "</b></font></p>";
        
_root.mensaje_txt.htmlText += "<p><font size='14'>" mensaje "</font>";
        
_root.mensaje_txt.htmlText += "<font color='#999999' size='12'>Publicado: " fecha "</font></p>";
        
_root.pantalla_mc.loadMovie(imagen);    
    }
    
indice=0;
noticias_xml = new XML();
noticias_xml.ignoreWhite true;
noticias_xml.load("noticias.xml");
noticias_xml.onLoad = function(){
            
cargarDatos(indice);            
    } 
XML

Código PHP:
<?xml version="1.0" encoding="iso-8859-1"?>
<noticias>
    <noticia fecha="02/12/2009"> 
        <titulo>Titulo 1</titulo>
        <mensaje>Noticia 1</mensaje>        
        <image>fotos/foto1.JPG</image>
    </noticia>
    <noticia fecha="02/12/2009"> 
        <titulo>Titulo 2</titulo>
        <mensaje>Noticia 2</mensaje>        
        <image>fotos/foto2.JPG</image>
    </noticia>
    <noticia fecha="02/12/2009"> 
        <titulo>Titulo 3</titulo>
        <mensaje>Noticia 3</mensaje>        
        <image>fotos/foto3.JPG</image>
    </noticia>
    <noticia fecha="02/12/2009"> 
        <titulo>Titulo 4</titulo>
        <mensaje>Noticia 4</mensaje>        
        <image>fotos/foto4.JPG</image>
    </noticia>
    <noticia fecha="02/12/2009"> 
        <titulo>Titulo 5</titulo>
        <mensaje>Noticia 5</mensaje>        
        <image>fotos/foto5.JPG</image>
    </noticia>
</noticias>

Última edición por AJVEvoluzione; 03/12/2009 a las 15:53
  #2 (permalink)  
Antiguo 03/12/2009, 10:46
Avatar de DarkskullDA  
Fecha de Ingreso: julio-2006
Mensajes: 698
Antigüedad: 17 años, 8 meses
Puntos: 13
Respuesta: Cómo poner solo los títulos ?

Código:
System.useCodepage = true; 
var indice:Number; 
var noticias_xml:XML; 

function cargarDatos(_indice:Number){
        var fecha:String;
        var titulo:String;
        var mensaje:String;
        var imagen:String;
        fecha = noticias_xml.firstChild.childNodes[_indice].attributes.fecha;
        titulo = noticias_xml.firstChild.childNodes[_indice].firstChild.firstChild.nodeValue;
        mensaje = noticias_xml.firstChild.childNodes[_indice].firstChild.nextSibling.firstChild.nodeValue
        imagen = noticias_xml.firstChild.childNodes[_indice].lastChild.firstChild.nodeValue
    ScrollBar.setScrollTarget(mensaje_txt);
    formStyleFormat             = new FStyleFormat;

        formStyleFormat.scrollTrack = "0xFFFFFF";
        formStyleFormat.highlight   = "0xFFFFFF";
        formStyleFormat.highlight3D = "0x6178EC";
        formStyleFormat.arrow         = "0x000099";
        formStyleFormat.face         = "0xAAAAAA";
        formStyleFormat.background  = "0x000000";
        formStyleFormat.shadow        = "0x6178EC";
        formStyleFormat.darkshadow    = "0x777777";
        
    formStyleFormat.addListener(ScrollBar);
    formStyleFormat.applyChanges();
        _root.mensaje_txt.htmlText = "";
        _root.mensaje_txt.htmlText += "<p><font color='#33CC00' size='15'><b>" + titulo + "</b></font></p>";
        _root.pantalla_mc.loadMovie(imagen);    
    }
    
indice=0;
noticias_xml = new XML();
noticias_xml.ignoreWhite = true;
noticias_xml.load("noticias.xml");
noticias_xml.onLoad = function(){
            cargarDatos(indice);            
    }
ps como0 ves solo mostramos el titulo en el mensaje_txt..
suerte,,
__________________
Curso Desarrollo De Aplicaciones IFrame Para Facebook Conoce la Graph Api, Javascript/PHP SDK, Dialogos, Pestañas, entre otros.
  #3 (permalink)  
Antiguo 03/12/2009, 15:48
Avatar de AJVEvoluzione  
Fecha de Ingreso: agosto-2004
Ubicación: Buenos Aires
Mensajes: 195
Antigüedad: 19 años, 7 meses
Puntos: 1
Respuesta: Cómo poner solo los títulos ?

A lo mejor me expresé mal, no solo el titulo de la primer noticia, sino que me coloque todos los títulos que tenga el xml
  #4 (permalink)  
Antiguo 05/12/2009, 01:01
Avatar de AJVEvoluzione  
Fecha de Ingreso: agosto-2004
Ubicación: Buenos Aires
Mensajes: 195
Antigüedad: 19 años, 7 meses
Puntos: 1
Respuesta: Cómo poner solo los títulos ?

Alguna ayudita por aca?
  #5 (permalink)  
Antiguo 05/12/2009, 10:49
Avatar de DarkskullDA  
Fecha de Ingreso: julio-2006
Mensajes: 698
Antigüedad: 17 años, 8 meses
Puntos: 13
Respuesta: Cómo poner solo los títulos ?

Código:
System.useCodepage = true; 
var indice:Number; 
var noticias_xml:XML; 

function cargarDatos(_indice:Number){
        var fecha:String;
        var titulo:String;
        var mensaje:String;
        var imagen:String;
        fecha = noticias_xml.firstChild.childNodes[_indice].attributes.fecha;
        titulo = noticias_xml.firstChild.childNodes[_indice].firstChild.firstChild.nodeValue;
        mensaje = noticias_xml.firstChild.childNodes[_indice].firstChild.nextSibling.firstChild.nodeValue
        imagen = noticias_xml.firstChild.childNodes[_indice].lastChild.firstChild.nodeValue
    ScrollBar.setScrollTarget(mensaje_txt);
    formStyleFormat             = new FStyleFormat;

        formStyleFormat.scrollTrack = "0xFFFFFF";
        formStyleFormat.highlight   = "0xFFFFFF";
        formStyleFormat.highlight3D = "0x6178EC";
        formStyleFormat.arrow         = "0x000099";
        formStyleFormat.face         = "0xAAAAAA";
        formStyleFormat.background  = "0x000000";
        formStyleFormat.shadow        = "0x6178EC";
        formStyleFormat.darkshadow    = "0x777777";
        
    formStyleFormat.addListener(ScrollBar);
    formStyleFormat.applyChanges();
        _root.mensaje_txt.htmlText = "";
        _root.mensaje_txt.htmlText += "<p><font color='#33CC00' size='15'><b>" + titulo + "</b></font></p>";
        _root.mensaje_txt.htmlText += "<p><font size='14'>" + mensaje + "</font>";
        _root.mensaje_txt.htmlText += "<font color='#999999' size='12'>Publicado: " + fecha + "</font></p>";
        _root.pantalla_mc.loadMovie(imagen);    
if(noticias_xml.firstChild.childNodes[_indice+1] != null){
indice++;
cargarDatos(indice); 
}
    }
    
indice=0;
noticias_xml = new XML();
noticias_xml.ignoreWhite = true;
noticias_xml.load("noticias.xml");
noticias_xml.onLoad = function(){
            cargarDatos(indice);            
    }

eeeeeeeee pues si te explicaste mal..
ahi sta bien
suerte...
__________________
Curso Desarrollo De Aplicaciones IFrame Para Facebook Conoce la Graph Api, Javascript/PHP SDK, Dialogos, Pestañas, entre otros.
  #6 (permalink)  
Antiguo 06/12/2009, 14:33
Avatar de AJVEvoluzione  
Fecha de Ingreso: agosto-2004
Ubicación: Buenos Aires
Mensajes: 195
Antigüedad: 19 años, 7 meses
Puntos: 1
Respuesta: Cómo poner solo los títulos ?

Muchas gracias DarkskullDA eso era lo que buscaba.
  #7 (permalink)  
Antiguo 07/12/2009, 14:45
Avatar de AJVEvoluzione  
Fecha de Ingreso: agosto-2004
Ubicación: Buenos Aires
Mensajes: 195
Antigüedad: 19 años, 7 meses
Puntos: 1
Respuesta: Cómo poner solo los títulos ?

Puede ser que me cargue solamente la última noticia? que esta mal?

Última edición por AJVEvoluzione; 09/12/2009 a las 16:50
  #8 (permalink)  
Antiguo 09/12/2009, 16:55
Avatar de AJVEvoluzione  
Fecha de Ingreso: agosto-2004
Ubicación: Buenos Aires
Mensajes: 195
Antigüedad: 19 años, 7 meses
Puntos: 1
Respuesta: Cómo poner solo los títulos ?

Me carga solamente la ultima notica, que es lo que falta? alguien me da una mano?
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 05:06.