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

code from flash pro CS5 to Flash Builder 4

Community Beginner ,
Jul 30, 2011 Jul 30, 2011

Copy link to clipboard

Copied

does anyone know how to get the code from flash CS5 to work to Flash builder 4?

heres the code:

import flash.filesystem.File;
import flash.filesystem.FileMode;
import flash.filesystem.FileStream;

movieClip_1.addEventListener(MouseEvent.CLICK, fl_SaveFile);

var fl_FileDataToSave:String = "Text to save to file.";

var fl_SaveFileStream:FileStream = new FileStream(); // FileStream used to write to the file

var fl_SaveFileChooser:File = File.documentsDirectory; // Default to the documents directory
fl_SaveFileChooser.addEventListener(Event.SELECT, fl_WriteFileHandler);

// Opens a Save As dialog box for user to specify a file name
function fl_SaveFile(event:MouseEvent):void
{
fl_SaveFileChooser.browseForSave("Save As:");
}

// Write data in fl_FileDataToSave variable
function fl_WriteFileHandler(event:Event):void
{
fl_SaveFileChooser = event.target as File;
fl_SaveFileStream = new FileStream();

fl_SaveFileStream.openAsync(fl_SaveFileChooser, FileMode.WRITE);

fl_SaveFileStream.writeMultiByte(fl_FileDataToSave, File.systemCharset);

fl_SaveFileStream.close();
}

Views

428

Translate

Translate

Report

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 ,
Jul 30, 2011 Jul 30, 2011

Copy link to clipboard

Copied

LATEST

Or is there a reference to it?

Votes

Translate

Translate

Report

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