Skip to main content
May 4, 2011 1:57 AM UTC
Answered

can i load xml file on iphone app?

i need load a xml on a ios app .. to display image and sound..

i heard the load functions are not allowed on ios apps

thats true?

This topic is closed to new replies. Start a new post to keep the conversation going.
Joe ... WardCorrect answer
Participating Frequently
May 4, 2011 2:17 AM UTC

You can load XML, data, images, etc. You can't load code. So, for example, if you loaded a SWF, you could access embedded assets, but none of the code would work.

3 replies

perbuch
Participant
May 12, 2011 7:17 AM UTC

I am working on an iOs application using a XML file - and it runs without any problems.

I store the file in the "data" folder relatively to the application folder:

   xmlReq = new URLRequest("data/"+quiz_XMLfile);
   //creates new XML instance and loads the xml file
   xmlLoader = new URLLoader  ;
   xmlLoader.load(xmlReq);
   //adds an event listener for successful completion of XML load.;
   xmlLoader.addEventListener(Event.COMPLETE,xmlLoaded);
  private function xmlLoaded(event:Event):void
  {
   var list_XML:XML = new XML(xmlLoader.data);

     ......

     }

Translate
Jul 19, 2011 3:35 PM UTC

Yes, this works, but make sure that you include this file in the command line call to adt.

In my case, i'm using a .bat script, but the line looks like:

call "%FLEX_SDK%adt.bat" -package %SIGNING_OPTIONS% iphone/CMAS3MO-%IPATYPE%.ipa application.xml bin/CMAS3MO.swf bin/icons Default.png data/leveldata.xml

Note the last item I added in there. This will effectively copy the data folder with leveldata.xml. Alternatively, I could add the whole data folder by just removing the /leveldata.xml at the end of the command.

Translate
Joe ... WardCorrect answer
Participating Frequently
May 4, 2011 2:17 AM UTC

You can load XML, data, images, etc. You can't load code. So, for example, if you loaded a SWF, you could access embedded assets, but none of the code would work.

Translate