|
-
Can someone recommend a Saving Info Example?
Can someone recommend a saving info example where variables could be passed out of a swf and saved into any type of file that is not web based? Like a text file or whatever, so long as the info can be passed to something on my hard drive. And of course a similar example that would allow retrieval of the variables back into the swf.
Thanks in advance!
Spit
-
Senior Member
I guess Im not clear..
if the original .swf web based? or a standalone (like an .exe) or something?
you can look into using a shared object which is like a Flash Cookie.. that can be 'saved' from the .swf to the local machine..and read back into the same .swf or another .swf on the same domain.
there is a quick example of how it works in my footer.
-
The swf. file would not be a standalone .exe file...
Which quick example should I look at in your footer?
And if I wanted to eventually put it up on the internet would it work? or would I have to seriously alter it to make it work for internet use?
-
Senior Member
the link called shared object...
and yes it works when the .swf is on-line..(web based).. and saves the cookie locally to the users computer.
-
-
WOW! This shared object example has opened up a whole new understanding of things I can do with Flash!
I spent so much time learning php and data base stuff just to have flash be able to save thing like _x and _y coordinates of objects. Now I don't need to go through all the hours of scanning through the Flash, the php, and the database to figure out why something isn't saving. Until now I didn't think flash was able to save things in any easy way.
I can't thank you enough!!!
-
Senior Member
well the php/DB stuff is good/better to learn because ultimately it gives you more control..
while Shared Object has its place its by no means 'secure' or fool proof..
I mean the user could delete it.. or even go read it.. so I wouldnt use it for sensitive data or anything..
just like you would for a cookie.
-
Senior Member
well the php/DB stuff is good/better to learn because ultimately it gives you more control..
while Shared Object has its place its by no means 'secure' or fool proof..
I mean the user could delete it.. or even go read it.. so I wouldnt use it for sensitive data or anything..
just like you would for a cookie.
-
I totally understand what you are saying about the security issues, and agree.
I am curious however to know how is it possible to access this shared object after the .swf creates it in the folder that it resides?
I understand how to find in on line as a cookie, but where is the file that this info is being sent to in the folder when I run the .swf just on my computer? I have the "show hidden files" option checked in my folder options section for that folder, but I still only see the .fla and .swf.
Thanks Again!
Spit
-
Senior Member
C:\Documents and Settings\userName-Account\Application Data\Macromedia\Flash Player\#SharedObjects
-
-
Directing the location of the save file...
I totally understand how this Shared Object concept works, and what I am wondering now is... is there a way to direct the saving of this shared object file to a specific folder using action script?
Thanks again! 
Spit
-
Senior Member
what do you mean? like save it to a folder on the desktop or something?
no, at least not that I know of.
I dont understand why you would want to though? what is it you want to do?
it can only be read by the .swf or another .swf on the same domain..
-
php isnt that secure either... just skip all the mumbo jumbo and do Ajax or jsp
-
The reason I'm asking is I'm teaching a basic flash game making course this summer and I want the students to be able to save variables locally on there computer.
Using this shared object is really easy way to do that, and I wanted them to be able to direct where the object is being saved to. This way they could keep a variable like a high score in the same folder as the swf they create, so that when they want to take there game home with them and move it to another computer all they need to do is move the folder all as one with this shared object in it.
-
 Originally Posted by SpitSpitSpitty
The reason I'm asking is I'm teaching a basic flash game making course this summer and I want the students to be able to save variables locally on there computer.
Using this shared object is really easy way to do that, and I wanted them to be able to direct where the object is being saved to. This way they could keep a variable like a high score in the same folder as the swf they create, so that when they want to take there game home with them and move it to another computer all they need to do is move the folder all as one with this shared object in it.
while if this was a client only game i wouldnt care. but the moment you make it a pool of students saving their collective score you would need to store it to the database. It will get you by imo... but i would look at server side stuff for a more interactive experience.
good luck!
-
 Originally Posted by rrutter81
while if this was a client only game i wouldnt care. but the moment you make it a pool of students saving their collective score you would need to store it to the database. It will get you by imo... but i would look at server side stuff for a more interactive experience.
good luck!
There not going to be saving a collective score, a high score is just one example of something they might save in there game. Any game a student saves will not be connected in any way with another students game, the variables saved will just be for that game the student is developing and will not be posted on a web site.
-
 Originally Posted by SpitSpitSpitty
There not going to be saving a collective score, a high score is just one example of something they might save in there game. Any game a student saves will not be connected in any way with another students game, the variables saved will just be for that game the student is developing and will not be posted on a web site.
then its just fine
-
OK, thank you for clearing that up. However, do you know a way I can direct where this shared object will be saved to? Is there a way to specify the folder I want it to go in?
-
 Originally Posted by SpitSpitSpitty
OK, thank you for clearing that up. However, do you know a way I can direct where this shared object will be saved to? Is there a way to specify the folder I want it to go in?
ill be honest with you buddy, ive only worked with server side storage, not local....
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|