Copy link to clipboard
Copied
Hello!
I am new in this forum!
Recently i have been developping an android application that loads an external XML.
In "Air Debug Launcher (Mobile)" it runs well, but in my smartphone it doesn't work as it should.
I discovered that the app (in my smartphone) doesn't load the XML.
I didn't get if the xml doesn't exist in .apk or it just cant find it.
Can you help me discovering what is going on?
var swf: Stage = ecra_container.stage;
swf.scaleMode = StageScaleMode.NO_BORDER;
var caminho: String;
var myXML: XML = new XML();
var XML_URL: String = "lista.xml";
var myXMLURL: URLRequest = new URLRequest(XML_URL);
var myLoader: URLLoader = new URLLoader(myXMLURL);
var ldr: Loader = new Loader();
myLoader.addEventListener("complete", xmlLoaded);
function xmlLoaded(event: Event): void {
//texto.text = "dentro da função";
myXML = XML(event.target.data);
for (var i: uint = 0; i < myXML.movie.length(); i++) {
lista.addItem({
label: myXML.movie.nome.text(),
data: myXML.movie.link.text()
});
lista.addEventListener(Event.CHANGE, reproduzir);
}
}
addChild(lista);
function reproduzir(event: Event): void {
caminho = event.target.selectedItem.data;
trace(caminho);
var Request: URLRequest = new URLRequest(caminho);
ldr.load(Request);
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, swf);
function swf(event: Event): void {
var proporcoes: uint = 2.259;
var t_x = ldr.width;
var t_y = ldr.height;
ldr.width /= proporcoes;
ldr.height /= proporcoes;
ecra_container.addChild(ldr);
}
}
Thank you very much!
Copy link to clipboard
Copied
you must add the lista.xml to your 'included files'.
Copy link to clipboard
Copied
Thank you very much!
I spent two entire days trying to reach the soluction!
Thank you!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now