El turno para Flash
En este momento, disponemos del contenido de nuestra base de datos en un formato que flash entiende. A partir de aquí, adaptarás flash a tus necesidades. A continuación dejo un sencillo ejemplo que carga productos.xml y visualiza los datos en la pantalla.
Abre un nuevo documento de flash y en el primer fotograma clave copia el siguiente código.
Actionscript:
-
// -- formato para mostrar el texto
-
var my_format:TextFormat = new TextFormat ();
-
my_format.font = "Verdana";
-
my_format.size = 10;
-
my_format.color = 0x000000;
-
// -- textfield para mostrar los datos en formarto HTML en columnas
-
var table_txt:TextField = this.createTextField ("table_txt", 1, 20, 20, 500, 200);
-
table_txt.html = true;
-
table_txt.multiline = true;
-
table_txt.wordWrap = true;
-
table_txt.htmlText = "<textformat tabstops='[50,250]'>";
-
// -- variables que conforman las columnas
-
var _rowHeaders:String;
-
var _row1:String;
-
var _row2:String;
-
var _row3:String;
-
// -- leer XML
-
var my_xml:XML = new XML ();
-
my_xml.ignoreWhite = true;
-
my_xml.load ("productos.xml");
-
my_xml.onLoad = parse;
-
// --
-
function parse (succes):Void {
-
if (succes) {
-
printScreen (this);
-
} else {
-
trace ("Error");
-
}
-
}
-
// -- mostrar los datos en la pantalla
-
function printScreen (xmlObj):Void {
-
var xmlNode:XMLNode = xmlObj.firstChild;
-
// -- cabeceras
-
_row1 = xmlNode.firstChild.childNodes[0].nodeName;
-
_row2 = xmlNode.firstChild.childNodes[1].nodeName;
-
_row3 = xmlNode.firstChild.childNodes[2].nodeName;
-
_rowHeaders = "<b>" + _row1 + "t" + _row2 + "t" + _row3 + "</b>";
-
table_txt.htmlText += _rowHeaders;
-
// -- registros
-
for (var i:Number = 0; i < xmlNode.childNodes.length; i++) {
-
_row1 = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
-
_row2 = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
-
_row3 = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
-
table_txt.htmlText += _row1 + "t" + _row2 + "t" + _row3;
-
}
-
// -- eof
-
table_txt.htmlText += "</textformat>";
-
table_txt.setTextFormat (my_format);
-
}
Archivos de ejemplo
Descarga Accestoflash
Accestoflash se ha descargado 1,360 veces.

(5 votos, promedio: 4.6 sobre 5)
Oye esto esta genial!!! recien he comenzado a entrar a investigar la manera de comunicar a Access con Flash, me he matado buscando la manera y esta es la más rapida y sencilla q han proporcionado... gracias!!!