[Flashcoders] Read and save xml file on disk (natalia Vikhtinskaya)

7 views
Skip to first unread message

Wenzler, Thomas

unread,
Feb 10, 2014, 6:03:30 AM2/10/14
to flash...@chattyfig.figleaf.com
You might look at mProjector or zinc or something in that lane. AFAIK these have the additional classes to let you write txt or xml to the filesystem without further permission by the user. But this only works as executable Projector, not via Browser.

Best regards, Thomas


Mit besten Grüßen aus Köln
stodt mediendesign GmbH

i. A. Thomas Wenzler-Horn

Multimedia-Entwickler


stodtmediendesign GmbH
Unter Krahnenbäumen 9
50668 Köln

Telefon: +49 (0)221 222 514 43
Telefax: +49 (0)221 222 514 50
wen...@stodt.de

www.stodt.de



Geschäftssitz: Köln - Amtsgericht Köln - HRB 32404,


Geschäftsführer: Carsten Stodt

Papier sparen für unsere Umwelt. Bitte drucken Sie diese E-Mail nicht unnötig aus!

Saving paper means protecting our environment. Please don´t print this e-mail unless you really need to.


-----Ursprüngliche Nachricht-----
Von: flashcode...@chattyfig.figleaf.com [mailto:flashcode...@chattyfig.figleaf.com] Im Auftrag von flashcode...@chattyfig.figleaf.com
Gesendet: Sonntag, 9. Februar 2014 18:00
An: flash...@chattyfig.figleaf.com
Betreff: Flashcoders Digest, Vol 76, Issue 3

Send Flashcoders mailing list submissions to
flash...@chattyfig.figleaf.com

To subscribe or unsubscribe via the World Wide Web, visit
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
or, via email, send a message with subject or body 'help' to
flashcode...@chattyfig.figleaf.com

You can reach the person managing the list at
flashcod...@chattyfig.figleaf.com

When replying, please edit your Subject line so it is more specific than "Re: Contents of Flashcoders digest..."


Today's Topics:

1. Read and save xml file on disk (natalia Vikhtinskaya)


----------------------------------------------------------------------

Message: 1
Date: Sun, 9 Feb 2014 20:53:35 +0400
From: natalia Vikhtinskaya <natav...@gmail.com>
Subject: [Flashcoders] Read and save xml file on disk
To: Flash Coders List <flash...@chattyfig.figleaf.com>
Message-ID:
<CAN6sgRhpSyxpXajiMDgQjwH1...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi to all friends
I have to create stand alone application that can read xml file then after editing save it on the disk. I need to do that by FlashCs6. I know that
FileReference.load() : Loads data from a file selected by the user.
FileReference.save() : Saves data to a file location selected by the user.
Is it possible to save and read without the user?
What is the better way for this task?
Do you know any good tutorials with examples on this subject? This task it new for me and I want to read about that more.

Thank you in advance.


------------------------------

_______________________________________________
Flashcoders mailing list
Flash...@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


End of Flashcoders Digest, Vol 76, Issue 3
******************************************

_______________________________________________
Flashcoders mailing list
Flash...@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

natalia Vikhtinskaya

unread,
Feb 10, 2014, 8:26:34 AM2/10/14
to Flash Coders List
If I understand all advices correctly I created small test Flash CS6 and
published as AIR app

// xml personnel file
var personnel:XML = <employees>
<employee id='1187' lastName='Davis' firstName='Charles'>
<office>CT</office>
<dept>Marketing</dept>
</employee>
<employee id='3383' lastName='Jones' firstName='Kevin'>
<office>NY</office>
<dept>Sales</dept>
</employee>
<employee id='2946' lastName='Samuels' firstName='Elizabeth'>
<office>CT</office>
<dept>Engineering</dept>
</employee>
</employees>

// new node appended
personnel.appendChild( <employee id='4002' lastName='Suzuki'
firstName='Kenji'>
<office>MA</office>
<dept>Sales</dept>
</employee> );
var prefsFile:File = File.applicationStorageDirectory;
prefsFile = prefsFile.resolvePath("personnel.xml");
var outputStringXML:String = personnel.toXMLString();
stream = new FileStream();
stream.open(prefsFile, FileMode.WRITE);
stream.writeUTFBytes(outputStringXML);

line
var prefsFile:File = File.applicationStorageDirectory;
gives mistake
Type was not found or was not a compile-time constant: File.

What is wrong here?
Reply all
Reply to author
Forward
0 new messages