tags:

views:

687

answers:

2

Hi, I am creating a xml object and adding a xml element via coding in flex. Finally, I need to save it as a xml file. How can this be done?

private var newtreeItems:XML = <items>
      <page caption="Page">                                                         
           <scene caption="Scene"></scene>                                                                   
      </page>                         
     </items>;

I need to save this as xml file from browser.

please send some link regarding this type of issue.

A: 

Is your app an AIR application or just a Flex web app.

From AIR you can save files to disk. For Flex web app you need a proxy script on a server that will get the xml as parameter from your flex app.. save it on server as a file and then send back to flex the file link where you can use again flex to save it :)

Not so easy to do it...

If someone else does not have already another solution for this i will create a tutorial for you later.

Adrian

Online Timesheet Software

Adrian Pirvulescu
A: 

Not possible only using a SWF running in the browser. As mentioned Air (the desktop variant for the Flash platform) can do it using the File Class.

Using the browser plug-in you are limited to:

  • upload a file to a server
  • download a file from a server

Here is Adobe documentation on how to do it in Flex 3 (MXML and AS3):

James Fassett