FLfile object
255
FLfile object
Availability
Flash MX 2004 7.2.
Description
The FLfile object lets you write Flash extensions that can access, modify, and remove files and
folders on the local file system. The FLfile API is provided in the form of an extension to the
JavaScript API. This extension is called a
shared library
and is located in the following folder:
■
Windows 2000 or Windows XP:
boot drive
\Documents and Settings\
user
\Local Settings\Application
Data\Macromedia\Flash 8\
language
\Configuration\External Libraries\FLfile.dll
■
Mac OS X:
Macintosh HD/Users/
userName
/Library/Application Support/Macromedia/Flash 8/
language
/Configuration/External Libraries/FLfile.dll
The FLfile methods work with files or folders (directories) on disk. Therefore, each method
takes one or more parameters that specifies the location of a file or folder. The location of the
file or folder is expressed as a string in a form very similar to a website URL. It is called a
file URI
(Uniform Resource Identifier) and is formatted as shown below (including the
quote marks):
"file:///
drive
|/folder 1/folder 2/.../filename"
For example, if you want to create a folder on the C drive called config and place it in the
Program Files/MyApp folder, use the following command:
FLfile.createFolder("file:///C|/Program Files/MyApp/config");
If you then want to place a file called config.ini in that folder, use the following command:
FLfile.write("file:///C|/Program Files/MyApp/config/config.ini", "");
To create a folder on the Macintosh, you could use the following command:
FLfile.createFolder("file:///Macintosh/MyApp/config");
NO
TE
Don't confuse the shared libraries that contain symbols in your Flash documents with
the JavaScript API shared libraries. They are two different things.
CHAPTER 17
Objects
Summary of Contents for FLASH 8-EXTENDING FLASH
Page 1: ...Extending Flash...
Page 38: ...38 Top Level Functions and Methods...
Page 532: ...532 Objects...
Page 554: ...554 C Level Extensibility...