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 8794583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:16:18+00:00 2026-06-13T23:16:18+00:00

I have my Flash project properties set for: AIR 3.4 for Desktop and ActionScript

  • 0

I have my Flash project properties set for: AIR 3.4 for Desktop and ActionScript 3.0…

I created a button for the user to select a file (csv) from the local drive. I then want to be able to get the string value of the File Object but do not know how…

Here is what I have so far:

BTN_CSV.addEventListener(MouseEvent.CLICK, getCSV);

var myFile:File = new File();

function getCSV(e:MouseEvent):void {
    var docFilter:FileFilter = new FileFilter("Documents", "*.csv");

    myFile.browse([docFilter]);
    myFile.addEventListener(Event.COMPLETE, completeHandler);
}


function completeHandler(event:Event) {
    var csvData = myFile.nativePath;
    csvData = csvData.data.split("\n");

    parseCSV(csvData);
}

I’m getting an error 1061: Call to a possibly undefined method split through a reference with static type flash.utils: ByteArray. I don’t know how to get the file path for the file obj…

  • 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-13T23:16:19+00:00Added an answer on June 13, 2026 at 11:16 pm

    The file class is basically just a pointer to the file you want.
    Your code is almost there you just need to add in the FileStream class.
    Source

    import flash.filesystem.*;
    import flash.events.Event;
    
    var file:File = File.documentsDirectory;
    file = file.resolvePath("Apollo Test/test.txt");
    var fileStream:FileStream = new FileStream();
    fileStream.addEventListener(Event.COMPLETE, fileCompleteHandler)
    fileStream.openAsync(file, FileMode.READ);
    
    function fileCompleteHandler(event:Event):void {
        var str:String = fileStream.readMultiByte(fileStream.bytesAvailable, File.systemCharset);
        trace(str);
        fileStream.close();
    }
    

    [EDIT]

    import flash.events.Event;
    import flash.filesystem.File
    import flash.filesystem.FileStream
    import flash.filesystem.FileMode
    
    var file:File =File.documentsDirectory;
    file.addEventListener(Event.SELECT,onSelect)
    file.browse()
    
    
    function onSelect(event:Event):void{
        var fileStream:FileStream = new FileStream();
        fileStream.open(file, FileMode.READ);
        var str:String = fileStream.readMultiByte(file.size, File.systemCharset);
        trace(str);   
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small flash project. I created a SWF from the flash sources.
I have a pure Actionscript 3 project, using flash.* libraries, compiles down to about
I have a project with Flash Professional CS5 and ActionScript 3. I need to
I have a Flash sprite in my Director project. Under the Properties of that
I have a Flash Professional CS5 project with ActionScript 3. I have a movieclip
I have a Flash builder project that I am migrating from SDK 4.1.0 to
I have a flash file (full link to flash looks like http://localhost:8888/PROJECT/swf/audio/player.swf ) which
I have a Flash CS5 project with an FLA file and 20 to 30
I am trying to port my pure-Actionscript Flash project to Flex Builder. I have
We have several Flash objects included in our project. We call each one a

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.