Enlaces en XML

  • nero2000
  • Born
  • Born
  • No Avatar
  • Registrado: Oct 03, 2007
  • Mensajes: 1
  • Status: Offline

Nota Octubre 3rd, 2007, 11:22 pm

¡Eh!! Nueva aquí - Necesito ayuda por favor :)

Im cargar un archivo XML en Flash, así:

Código: [ Select ]
<?xml version="1.0" encoding="UTF-8"?>

<loc>
<locations>
<p>
<a href="http://www.link.com">link one</a> <BR>
<a href="http://www.link.com">link two</a> <BR> 
<a href="http://www.link.com">link three</a><BR>
</p>
</locations>
</loc>


  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <loc>
  3. <locations>
  4. <p>
  5. <a href="http://www.link.com">link one</a> <BR>
  6. <a href="http://www.link.com">link two</a> <BR> 
  7. <a href="http://www.link.com">link three</a><BR>
  8. </p>
  9. </locations>
  10. </loc>


pero quiero que los enlaces para abrir en una nueva ventana .. así que he intentado añadir _blank después de que el vínculo, y el wouldnt de texto, incluso la carga en flash. ¿Cómo puedo hacer esos calculos en ventanas nuevas?

Heres el código en flash:

Código: [ Select ]
loc_txt.html = true;
loc_txt.wordWrap = true;
loc_txt.multiline = true;
loc_txt.label.condenseWhite=true;

//load css
locations = new TextField.StyleSheet();
locations.load("_load/style.css");
loc_txt.styleSheet = locations;

//load in XML
locations = new XML();
locations.ignoreWhite = true;
locations.load("_xml/edit.xml");
locations.onLoad = function(success)
{
    if(success)
    {
        loc_txt.text = locations;
    }
}
  1. loc_txt.html = true;
  2. loc_txt.wordWrap = true;
  3. loc_txt.multiline = true;
  4. loc_txt.label.condenseWhite=true;
  5. //load css
  6. locations = new TextField.StyleSheet();
  7. locations.load("_load/style.css");
  8. loc_txt.styleSheet = locations;
  9. //load in XML
  10. locations = new XML();
  11. locations.ignoreWhite = true;
  12. locations.load("_xml/edit.xml");
  13. locations.onLoad = function(success)
  14. {
  15.     if(success)
  16.     {
  17.         loc_txt.text = locations;
  18.     }
  19. }



Gracias chicos!
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Octubre 3rd, 2007, 11:22 pm

  • RedBMedia
  • Proficient
  • Proficient
  • Avatar de Usuario
  • Registrado: May 01, 2007
  • Mensajes: 315
  • Status: Offline

Nota Octubre 6th, 2007, 6:50 pm

¿Qué quiere decir que haya añadido la "_blank" después de la relación?

Heres un buen anclaje etiqueta que se abrirá en una nueva ventana:

<a target="_blank" href="http://www.link.com"> un link </ a>
Joe Hall
  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Octubre 8th, 2007, 6:04 pm

no es el objetivo "_new" si quieres algo que se abrirá en una ventana nueva o diferente es XML?

Y hay que <a href="http://www.link.com" target="_new"> Link </ a> en vez de <a target = "_new" href = "http://www.link. com "> </ a>.
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • graphixboy
  • Control + Z
  • Mastermind
  • Avatar de Usuario
  • Registrado: Jul 11, 2005
  • Mensajes: 1828
  • Loc: In the Great White North
  • Status: Offline

Nota Octubre 8th, 2007, 6:29 pm

La especificación de orden dentro de la etiqueta <a> no debe hacer ninguna diferencia.

Creo que los atributos del objetivo aceptables son:

_blank
_new
_self
_pare no
frameName


La gran pregunta es si flashs capacidad limitada para interpretar HTML permite el uso de metas en HTML externo. Para estar seguro que iría con _blank. Sin embargo, si aún no funciona es posible que desee cargar el XML como atributos (no HTML tags) y utilizar una función getURL que sería algo como esto.

Código: [ Select ]
<?xml version="1.0" encoding="UTF-8"?>
<linkList>
 <link url="http://www.link.com" text="Link Title" targ="_blank" />
 <link url="http://www.link.com" text="Link Title" targ="_blank" />
 <link url="http://www.link.com" text="Link Title" targ="_blank" />
</linkList>
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <linkList>
  3.  <link url="http://www.link.com" text="Link Title" targ="_blank" />
  4.  <link url="http://www.link.com" text="Link Title" targ="_blank" />
  5.  <link url="http://www.link.com" text="Link Title" targ="_blank" />
  6. </linkList>


y ActionScript

Código: [ Select ]
var url = node.attributes.url;
var title = node.attributes.text;
var targ = node.attributes.targ;

onSomeAction = function(){
getURL(url,targ);
}
  1. var url = node.attributes.url;
  2. var title = node.attributes.text;
  3. var targ = node.attributes.targ;
  4. onSomeAction = function(){
  5. getURL(url,targ);
  6. }
  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Octubre 8th, 2007, 8:15 pm

graphixboy escribió:
El orden dentro de la especificación <a> etiqueta no debe hacer ninguna diferencia.


No, al menos lo hizo para mí. He intentado de esa manera una vez y terminó con un error.
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • Avatar de Usuario
  • Registrado: May 28, 2003
  • Mensajes: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Nota Octubre 8th, 2007, 9:40 pm

Lea cuidadosamente este puesto. Creo que va a proporcionar la respuesta que usted necesita
http://board.flashkit.com/board/showthread.php?t=691428

Tuve un momento difícil hacerlo yo mismo.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • graphixboy
  • Control + Z
  • Mastermind
  • Avatar de Usuario
  • Registrado: Jul 11, 2005
  • Mensajes: 1828
  • Loc: In the Great White North
  • Status: Offline

Nota Octubre 9th, 2007, 6:10 am

Bogey escribió:
No, al menos lo hizo para mí. He intentado de esa manera una vez y terminó con un error.


Creo que importa el orden basado en el DOCTYPE. Sin embargo, el flash no es un navegador web. Tiene una muy limitada comprensión de html sino que se refiere a html como xml con algunos atributos nombre.

Publicar Información

  • Total de mensajes en este tema: 7 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 35 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC