Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-18-2004, 12:44 PM
Junior Member
 
Join Date: Oct 2004
Posts: 1
Default Saving files

When I trying to save a stream to a file, with the following script, the trace gives me undefined.... any ideas??

Code:
  
var theXML;
trace(theXML = FlashPlayer.getVariable("_level0.theXML"));

trace(df = "c:\\presentation.xml");
trace(file_stream = new FileStream(df,"w"));
trace(file_stream.writeUnicodeString(theXML));
Reply With Quote
  #2 (permalink)  
Old 10-19-2004, 09:55 AM
Member
 
Join Date: Jan 2003
Posts: 56
Default Re:Saving files

try something like:

Code:
thexml = FlashPlayer.getVariable("_root.theXML");
trace(thexml);
//or maybe
// Dialogs.msgBox("theXML variable:"+thexml);
// If it gives you an undefined here, then check to see if
// the _root.theXML variable even exists (open the swf
// in Flash and then view the variables Ctrl+Alt+V)

df = "c:\\presentation.xml";
trace(df);
file_stream = new FileStream(df,"w");
trace(file_stream);
file_stream.writeUnicodeString(thexml);
// or try:
// file_stream.writeLine(thexml);
file_stream.close();
//might need that close statement
Reply With Quote
  #3 (permalink)  
Old 10-19-2004, 02:27 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Saving files

The writeUnicodeString method returns nothing, so you get undefined in the trace window. As you want to write a XML file, please use the "write" or "writeLine" method instead of the "writeUnicodeString" method.
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 09:44 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.