Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/03/2010, 04:41
Avatar de andrewp
andrewp
 
Fecha de Ingreso: agosto-2003
Ubicación: Barcelona
Mensajes: 1.160
Antigüedad: 20 años, 9 meses
Puntos: 5
Abrir archivo con "tree component"

Saludos,

He seguido algunos tutoriales para mostrar un directorio a través de "tree component" de flash.

El archivo xml contiene la siguiente información:

Código PHP:
<?xml version="1.0" encoding="iso-8859-1"?>
<node label = "Archivos de 2009">
    <node label = "Archivos en version PDF">
        <node label = "Dietas" url="/dietas/regargosEnero.pdf"/>
        <node label = "Costos" url="/costos/trimestre1.pdf"/>
        <node label = "Balances" url="/balance/extracto-1.pdf"/>
    </node>
</node>
Siguiendo el tutorial, hago la llamada del xml desde mi flash a través dle siguiente código:

Cita:
stop();
// create xml object
var xml:XML = new XML();
// ignore any white space
xml.ignoreWhite = true;
// onload xml function
xml.onLoad = function() {
// link tree to xml file database
Tree.dataProvider = this.firstChild;
};
// load xml file
xml.load("archivo.xml");
// create obj for the tree listener
var treeListener:Object = new Object();
// event function for listener
treeListener.change = function() {
// what is clicked on in tree
var item = Tree.selectedItem;
// the url attribute of that item
var myurl = item.attributes.url;
// if there is an element
// and it is not a folder
if (myurl) {
// open PDF files
// or play Video files
// or show a picture
trace("Selected: "+myurl);
}
};
// register listener with function and object
Tree.addEventListener("change",treeListener);
El código marcha bien y puedo leer la estructura en la animación .swf y el "trace" me genera el mensaje sin problemas. Sin embargo, no puedo abrir el fichero .PDF .

Podríais ayudarme con el código para abrir dichos fichero?

Gracias de antemano!
__________________
Andrew :P