A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Save FSCommand saving proto and construct.

  1. #1
    ActionScript.org
    Join Date
    Aug 2000
    Posts
    1,030
    Does anyone know under what circumstances fscommand("save","file.txt"); saves the __proto__ and construct variables?

    Further explaination:
    I'm using this (now outlawed by MM) undocumented function to save XML objects as strings. The problem is that it's saving the __proto__ and construct Flash environment variables along with the string I want it to save and they screw up the re-constructor as well as make my file sizes slightly bigger.
    I can delete them when the file is loaded up later on but that's a work around and I'd rather know what causes the issue.
    The variables I wish to save are set up on _root just before the save command is run. The app is quite complicated but when I make a simple replica with less code it doesn't happen so I'm stuck...

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    have you tried to move the problematic code and objects into a movieclip?

    Musicman

  3. #3
    ActionScript.org
    Join Date
    Aug 2000
    Posts
    1,030
    Musicman,

    Thanks for the responce. I don't believe that would work as the save fscommand saves only the variables on root if I'm correct. I'm actually exploiting that fact as I have nummerous MCs with variables in them but I'm compiling all the data into one XML object and puting that alone on the root, so that when I use "save" the XML is all that is saved, and indeed it works, but I get those two additional variables.
    I have now discoverred that the additional variables only show up when I run "save" over a root timeline with an XML object on it. In the tests I've run the variables do not appear if I try to save just strings / numbers. They do however appear when I try to save an XML object and also when I convert an object to a string, delete the original object and try to save just the string. Quite annoying. Further they cannot be deleted before saving, nor after reloading (in another SWF)...
    Finally, when saving just strings (which does not cause these variables to be saved), tracing 'constructor' before or after the save command results in the same output that is written to the text file when I use XML objects; so the variables exist in both cases, but are only written when I save an XML Obj or a an XML Obj converted to a stirng. Thanks for botherring to read this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center