Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-05-2007, 01:54 AM
Senior Member
 
Join Date: Nov 2007
Posts: 128
Default Ways to save Variables in a text files.

I want to be able to save text to a text file from Ffish in a way that flash can read.. My current script is:

var textArea = FlashPlayer.getVariable("notes_txt.text");
var myfile = new Stream("notes.txt");
myfile.write("&myVar"+FlashPlayer.getVariable("i") +"="+textArea);
myfile.close();

And this works, but it glitches sometimes, i.e.: Writes over other text, and adds a square shaped symbol. I use SWFKit 2.2.
Reply With Quote
  #2 (permalink)  
Old 11-07-2007, 06:39 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: Ways to save Variables in a text files.

The text may contain special characters. Can you please send us (to support@swfkit.com) some text that causes problem?
Reply With Quote
  #3 (permalink)  
Old 11-08-2007, 03:07 PM
Senior Member
 
Join Date: Nov 2007
Posts: 128
Default Re: Ways to save Variables in a text files.

How does SWFkit 2.2 read variables from text files? Can it save directly to a variable inside a text file?
Reply With Quote
  #4 (permalink)  
Old 11-12-2007, 05:48 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: Ways to save Variables in a text files.

Sure. The simple way is to save variables like "var1=hello&var2=world". e.g.
Code:
var f = new FileStream(getAppDir() + "output.txt", "w");
f.write("var1=" + FlashPlayer.getVariable("var1") + "&var2=" + FlashPlayer.getVariable("var2"));
f.close();
and then in flash you can use the LoadVar object to read variables from the "output.txt".
Reply With Quote
  #5 (permalink)  
Old 11-14-2007, 10:52 PM
Senior Member
 
Join Date: Nov 2007
Posts: 128
Default Re: Ways to save Variables in a text files.

That's pretty much like what I'm doing already, unless I didn't understand you. Can swfkit overwrite only the variable in a text file I tell it too? Oh yeah, and the charector that shows up is like this, except it's a complete square: []
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:37 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.