all groups > flash exchange extensions > november 2005 >
You're in the

flash exchange extensions

group:

which filetypes can be opened with FLfile.read()


which filetypes can be opened with FLfile.read() dr_ross
11/26/2005 3:52:44 PM
flash exchange extensions:
hi all, just wondering which filetypes people had ahd any luck with opeing
using the file API's read function. Text and xml and anyother non formatted
textbased files are sucessful and others just return a line of random data if
anything at all. Would be nice not having to make an external c# app to convert
file to XML all the time before using the data in a jsfl script. Especialy
things like .mdb's
Re: which filetypes can be opened with FLfile.read() Jigar Mehta
12/12/2005 11:51:09 AM
Hi!it was nice to know that XML file could be read using FLfile.read().But
itried that and can u also let me know how do i view whether what has it read
and how does i know what has the function returned.
Below is the way i tried to read an xml file:-

originalFileURI="file:///D:/helpXml/TabHelp.xml";
code = FLfile.read(originalFileURI);

Can u also let me know do u write it to an existing XML file located at some
different location.I tried it but it gives me an error saying the :- "Refernce
Error-The FLfile is not defined"
If it means that the file does not exist then,it is wrong b'coz the file does
exist and it might not be able to find it.I wonder how?
This is the way i tried it:-

newFileURI="file:///C:/Documents and Settings/jigarm/Local
Settings/Application Data/Macromedia/Flash MX
2004/en/Configuration/ActionsPanel/CustomActions/TabHelp.xml";
Flfile.write(newFileURI,code);
Re: which filetypes can be opened with FLfile.read() dr_ross
12/12/2005 12:05:51 PM
if you're getting the FLfile not defined lark, it means your either not
referencing it right, or you don't have flash 7.2 or 8, if you have flash
mx2004 make sure you've run the updater to 7.2 as the FLfile commands only come
with that.

On the first point in the example
originalFileURI="file:///D:/helpXml/TabHelp.xml";
code = FLfile.read(originalFileURI);

the variable "code" is everything readable in the document, so if you were
reading in your XML doc, then added the line fl.trace(code), that would trace
out everything you've read with FLfile.read() into the output panel.

On the second point use the fl.configURI code instead of the whole link to
your config folder, so
newFileURI="file:///C:/Documents and Settings/jigarm/Local
Settings/Application Data/Macromedia/Flash MX
2004/en/Configuration/ActionsPanel/CustomActions/TabHelp.xml";
Flfile.write(newFileURI,code);

would become

Flfile.write(fl.configURI+"ActionsPanel/CustomActions/TabHelp.xml",code);

if its still not working run a check exists first with fl.exists() if that
returns true check the file isn't read only, if it returns false then the
linkage to the file is faulty
AddThis Social Bookmark Button