A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 24

Thread: SAVE a TXT file on user's PC with PROJECTOR

  1. #1
    Special Member Tea_J's Avatar
    Join Date
    Dec 2000
    Posts
    991
    How???

    like, create TXT's within the folder where the projector resides.. let's say for example, hi scores and stuffs..


    I had a method before in Flash 5 via, FS COMMAND "save","data.txt"

    but, this doesnt work with Flash MX!!! Sucks.. so, besides using the SharedObject method (w/c is to complex), what other SIMPLE means of achieving this.....

    Im starting to miss my FLASH 5..... This really suckz in MX!!!! hmmp!

  2. #2
    Special Member Tea_J's Avatar
    Join Date
    Dec 2000
    Posts
    991
    SOmeone on flashkit has got to know this..

  3. #3
    Pillow Daddy m_andrews808's Avatar
    Join Date
    May 2001
    Location
    London England
    Posts
    924
    Macromedia have disabled the fscommand save in MX, can't remember why, but other than the shared object I don't think there is a way of doing what you want.

  4. #4
    Senior Member
    Join Date
    Mar 2000
    Posts
    111

    always a way

    ho ho ho
    I have only one thing to say and that is ...
    One day mm Flash will be an add on to northcode's swf studio!
    If you are doing standalones with flash I would seriously recoment you use swf studio, I have been keeping my mouth shut about this prog for so long it hurts. check out the plug ins section and dance a little dance.

    http://www.northcode.com



  5. #5
    Look on macromedia's site for the tutorial on shared objects. You can store text and all kinds of other stuff as cookies.


  6. #6
    Gmail is here
    Join Date
    Jun 2001
    Location
    United Kingdom
    Posts
    168

    you may be wrong

    I believe Macromedia flash MX can do the things that you say and therefore it may help if you read the manual.

  7. #7
    Special Member Tea_J's Avatar
    Join Date
    Dec 2000
    Posts
    991

    Re: you may be wrong

    yeah.. i guess... but damn.. all I want for now is the SAVE data.txt stuff!!!!! Like save in as plain txt in the same folder as my Projector.. Hmm... Maybe MX still has that save FScommand, but in another form.. anybody??


  8. #8
    Senior Member
    Join Date
    Aug 2000
    Posts
    139
    The save command has been removed, it was unsupported and was only left in Flash 5 projectors by mistake.

    If you need to store data, use Shared Objects, if you need to write to a text file, use a custom projector like SWF Studio.

  9. #9
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Tea_J... Don't get your hopes to high up, but this could maybe work!

    Curiously, using a saver.exe (that I got a while back!), I can manage to create a txt.txt file in the fscommand folder, but can't pass arguments (the variables I would want to save) to this text file. Funny, that I could still create the text file in MX, but can't pass variables to it.
    Anybody know how to pass such arguments along with an executable?

    fscommand("exec", "saver.exe" + variables (in fact arguments of "saver.exe")????);

  10. #10
    Special Member Tea_J's Avatar
    Join Date
    Dec 2000
    Posts
    991
    I got that to while back.. I think it's from our TUTORIAL SECTION.. But, we have the same problem.. Cant seem to pass variables to the TXT.. something's wrong with it..

    Anyways, that "Save" FSCOmmand from Flash 5 was great! I wonder why they took it off in Flash MX!!!! GRRR!!!! It was soo neat! It doesnt even bring up a DOS promt and stuff like the other methods..


    ANYBODY OUT THERE WHO CAN HELP ME DO THE SAME THING IN MX??? I was told about the SHaredObject stuff, BUT IT ONLY WORKS WITH BROWZERS or something like that..


    I REALLY NEED TO ACHIEVE THIS "write to text" with PROJECTORS! I've been searching for an answer for 1 week now.. ANYBODY??!!!!


    PS
    Tnx though, oldnewbie

  11. #11
    Shared Objects work with Text, in Projectors AND swfs ON or OFF the web here's an example:

    YourLocalSO = sharedobject.getLocal("Yourcookie");
    if (YourLocalSO.data.name != null) {
    YourText.text = YourLocalSO.data.name;
    } else {
    YourText.text = "Enter Description";
    }
    YourText.onChanged = function() {
    YourLocalSO.data.name = YourText.text;
    };

    Line 1 creates a cookie file called Yourcookie on the hard drive of the local machine. If there is something already in the file (YourLocalSO.data.name) it will return that value. If not (else) it will return "Enter Description"

    The final line just changes the text.

    Hope this helps...

  12. #12
    Special Member Tea_J's Avatar
    Join Date
    Dec 2000
    Posts
    991
    Oh yea??? Sure about this dude??

    ok, since you're good at this SharedObject thing in flash, mind of I ask you some questions?

    like, when I store this so called cookie "on steroids", will I be able to store MY DEFINED variables? Or just the user name?? pardon my ignorance.. can I like specify what are the vars? like, names, passwords, high scores and such/?

    Thanx BoldBike

  13. #13
    Senior Member
    Join Date
    Mar 2000
    Posts
    210
    hi, i have made a flash 5 player "write all root variables to text" application. now i have to upgrade everything to flash mx because i need to implement unicode text.

    question: with the "shared objects" feature, is it still possible to write "all root variables" to a file, or do i have to specify every "write variable command" in detail?

    thanks!

  14. #14
    Junior Member
    Join Date
    May 2001
    Posts
    19
    Never used Northcode swf Studio. I'll check it out. Thanks for the link.

  15. #15
    Senior Member
    Join Date
    Jan 2001
    Posts
    106

    Smile

    hi tea_j,

    You can pretty well set your own variables and use the shared object. But mind to store less data as Shared Objects as its own memory restriction which can be set by the user. IF he disables the Shared Object your program will get stuck. otherwise its a very good option to use for minimal data.

    regard
    gnana

  16. #16
    Senior Member
    Join Date
    Mar 2000
    Posts
    210
    nice footer - thek

  17. #17
    Banned By GMF Wannabe Gambini's Avatar
    Join Date
    Oct 2000
    Posts
    976
    Download a copy of Flash Studio from:
    http://www.multidmedia.com/fls

    It's completely free for personal use and it allows you to save to any type of file, save and load from the registry, dynamicly change projector size, position, scale etc etc far too many features to list here!

    You can also download a sample exe created with Flash Studio at:
    http://www.multidmedia.com/fls/flashstudio_sample.exe

    and the source code:
    http://www.multidmedia.com/fls/flash...ple_source.fla

    Hope this helps.

  18. #18
    Senior Member
    Join Date
    Mar 2000
    Posts
    210
    hi, gambini
    i tested flash studio some days ago, and i saw
    that there is no command to write all root variables to
    a file (like it was with the "fs save command" in flash player 5) .
    is that right?

    p.s:
    every time i opened a projector file generated with
    flash studio trial, the contend was visible for a second on
    the stage, then everything except the stage color disappeared.

  19. #19
    Well that just sucks, I knew I had done it before, but I *@#&^ng need to be able to do it in MX :-\ (save to a text file.) Cookies are insufficent for any actual program made, I'm making a full fledged chat application and there's no way I can get by with saving settings in a cookie.

    *starts download on Flash Studio*

  20. #20
    Master Poo Flinger
    Join Date
    Sep 2000
    Posts
    318
    this is off the top of my head, but you can create functions that's 1 line execution for saving variables:
    Code:
    function saveVarsFor (mc)
    {
    	so = SharedObject.getLocal ("my_appname_data", "/");
    	for (var current_variable in mc)
    	{
    		var tmpItem = mc[current_variable];
    		if (typeof (tmpItem) != "movieclip" && typeof (tmpItem) != "function")
    		{
    			so.data[current_variable] = tmpItem;
    		}
    	}
    	so.flush ();
    }
    function loadVarsInto (mc)
    {
    	so = SharedObject.getLocal ("my_appname_data", "/");
    	for (var current_variable in so.data)
    	{
    		mc[current_variable] = so.data[current_variable];
    	}
    }
    loadVarsInto (_root);
    if (_root.last_player == undefined)
    {
    	_root.last_player = "Player 1";
    	saveVarsFor (_root);
    }
    the limitations i've noticed for this is that you can't save functions and movieclips. you can save simple objects, but you can't save user defined classes that have functions. since you were just planning to save to a textfile, that shouldn't be a big deal. the advantage to the shared object over textfiles is you'll be able to save information on other supported operating systems. to me, the shared object is the way to go. 100k is more than enough to save user settings and simple logs.

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