|
|||
|
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));
|
|
|||
|
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
|
|
|||
|
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.
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|