Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8219487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:10:51+00:00 2026-06-07T13:10:51+00:00

My Air 2.5 application needs to save some text files inside some custom folder.

  • 0

My Air 2.5 application needs to save some text files inside some custom folder.

Currently i am using documents folder to save files (using FileStream), which works fine. But i need to save it inside any folder.

Is there a way to save files in any targeted folder? (using FileStream)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T13:10:53+00:00Added an answer on June 7, 2026 at 1:10 pm

    I have got the working solution. It saves file to your targeted folder. It might help you.

    /*Requires AIR 2.5 (May be AIR 2.0. I have not tested) and Flash CS6.*/
    import flash.filesystem.*;
    import flash.utils.ByteArray;
    
    //Sample XMl
    var xml:XML = <audio>song1.mp3</audio>;
    var outputString:String = '<?xml version="1.0" encoding="utf-8"?>\n';
    outputString +=  xml.toXMLString();
    outputString = outputString.replace(/\n/g,File.lineEnding);
    
    //Byte array
    var xmlData:ByteArray = new ByteArray();
    xmlData.writeUTFBytes(outputString);
    
    //Targeted custom folder
    var urlStr:String = "file:///D:/Temp/"; // you can get this URL from external text file
    var audioXMLFile:File = new File();
    audioXMLFile.url = urlStr;
    audioXMLFile = audioXMLFile.resolvePath("SongList.xml");
    
    //File stream
    var outStream:FileStream = new FileStream();
    outStream.addEventListener(Event.CLOSE, dataSaved, false, 0, true);
    outStream.addEventListener(OutputProgressEvent.OUTPUT_PROGRESS, savingProgress, false, 0, true);
    
    //open output file stream in WRITE mode
    outStream.openAsync(audioXMLFile, FileMode.WRITE);
    
    //write out the file
    outStream.writeBytes(xmlData, 0, xmlData.length);
    
    //Saving progress
    function savingProgress(e:OutputProgressEvent):void
    {
        if (e.bytesPending == 0)
        {
            //Close stream on save
            e.target.close();
        }
    }
    
    // 
    function dataSaved(e:Event):void
    {
        trace("File Saved");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My Flash (AS3/AIR) application is currently using a slightly unusual architecture (for a Flash
I need to create a installer package which application i developed using flex air.
I would like to make some AIR application which would be used for tracking
I have an AIR application in which I have to start some native applications
I'm developing a Adobe AIR application using Flash Builder 4. This app needs to
I am developing an AIR application. This application needs some hardware accesses that are
I am building one desktop application in Air2.5, which needs to record and save
I am writing an Adobe AIR application that needs to build in a CI
I have an Air application that lets users import jpg, png and swf files
I need to send data from an Air application, using a certificate. This certificate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.