Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

[Flash CS5 Air for Android App] Doesn't load external XML on smartphone

Community Beginner ,
Dec 07, 2016 Dec 07, 2016

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!

TOPICS
ActionScript
293
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 07, 2016 Dec 07, 2016

you must add the lista.xml to your 'included files'.

Screenshot - 12_7_2016 , 10_07_19 AM.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 08, 2016 Dec 08, 2016
LATEST

Thank you very much!

I spent two entire days trying to reach the soluction!

Thank you!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines