soy nueva en esto del action script y necesito hacer una pagina de internet que sea cargada desde el action script pero que este atraiga a los archivos desde un XML y no se como hacerlo..
lo que llevo hasta el moemnto es esto pero no se si realmente este bueno..
System.useCodepage = true;
var mi_xml = new XML();
mi_xml.ignoreWhite = true;
// borra los espacios...para que sea seguido
mi_xml.onLoad = function(ok) {
if (ok) {
crear_bots(this);
} else {
trace("error al cargar xml");
}
};
mi_xml.load("laberinto.xml");
var crear_bots = function (xml) {
var secciones = xml.firstChild.childNodes;
for (i=0; i<secciones.length; i++) {
var sec = this.attachMovie("imagenes", "sec"+i, this.getNextHighestDepth());
sec._x = i*(sec._width+10)+100;
sec._y = 50;
sec.txt.text = secciones[i].attributes.nombre;
var vacio = this.createEmptyMovieClip("v"+i, this.getNextHighestDepth());
vacio._x = sec._x;
vacio._y = sec._height+10+sec._y;
var vinculos=secciones[i].childNodes;
for(j=0;j<vinculos.length; j++){
var vinc=vacio.attachMovie("imagenes", "vin"+j,vacio.getNextHighestDepth());
//para la posicion//
vinc._y= (vinc._height+10)*j;
//para que ponga todos en el eje y//
vinc.txt.text=vinculos[j].attributes.nombre;
var accion=vinculos[j].attributes.tipo;
if(accion=="lm"){
vinc.btn.onRelease=function(){
cargar_img(this.acciones);
}
}else if(accion=="video"){
vinc.btn.onRelease=function(){
cargar_video(this.acciones);
}
}
vinc.btn.acciones=vinculos[j];
}
sec.btn.onRelease=function(){
mostrar(this.vacio);
}
sec.btn.vacio=vacio;
vacio._visible=false;
}
};
var mostrar=function(cual){
for(i=0;i<cant;i++){
eval("v"+i)._visible=false;
}
cual._visible=true;
}
var cargar_img=function (datos){
t_txt.text=datos.attributes.nombre;
d_txt.htmlText=datos.firstChild;
d_txt.htmlText=d_txt.text;
d_txt.scroll=1;
img_mc.loadMovie(datos.attributes.link);
}
tambien en el mismo movie clip en el que tengo cargando las imagenes tengo que hacer que cargue videos pero qeu cuando los cargue borre la imagen que esta ahi en el movie clip
y asi sucesivamente.
muchas gracias si me colaboran lo mas pronto posible .
les deberia el alma y una buena nota
