If we can't save/load to/from file, how can we use the INI object that has been ported to flash?
Printable View
If we can't save/load to/from file, how can we use the INI object that has been ported to flash?
The data is saved in a temporary file (I'm not sure where, but I think it might actually be a cookie) on the user's computer.
So how do you use that temporary file exactly?
Just use the INI as you would do in C++. The file is not temporary, it is saved between sessions.
I have a feeling we are talking about different things. That or I am missing something obvious.
I just dropped an INI object in the frame and tried to set and get values. They do not work. Do I need to specify a special filename/path for this to work?
I have the same problem.
Any chance of someone making a basic ini in flash tutorial?
I attached an example file.
Mokhtar - What you did seems to work for me, but you must compile it to a swf file and run it in a browser.
Thanks netninja,
Where is the ini data stored?
I don't actually know. I just made this example when flash first came out to see how the INI worked. But as you can see, it does save it somewhere. Someone mentioned that it disappears when you delete your browser cache, but I haven't tried that yet.
I searched for my own test and found it here:
C:\Documents and Settings\Username\Application Data\Macromedia\Flash Player\#SharedObjects\A676F9PT\#localWithNet\Docum ents and Settings\Username\My Documents\My Games\MMF2\INItest.swf\SearchForThisPlease.ini.sol
So, apparently it's going to be different every time you make and use a flash game/app using the ini file.
If you want to save data from your flash application, use a PHP script and the Get object. It's a bit useless saving it client side :)
That's true, Jamie. I thought we could read the ini (or anything sort of file) from the server-side if it resided somewhere specific.
Thanks for the example netninja, I was just running mine from within MMF without ctrl-run.
Well, it's obviously impossible to save an INI file back to the server. I guess it'd be nice to read them from the server.
Not being able to save makes sense without a server component. Hmm... I don't know how MMF handles virtual files, but if we can somehow have a virtual files structure in MMF where we access files stored in memory as if they were on disk then we could do interesting stuff like getting a whole ini of xml file from server, putting it in the virtual structure then using it with the normal objects, except that it won't be saved back to server.
I don't know how MMF dealt with embedded external files in normal applications, but I suppose it was something similar.
Is it possible to use the edit box object to grab text files and other files from the web like the active picture object does? I haven't tested but this may be what you're looking for in some way.
I don't think so LB.
Marv
Is there any alternative to using PHP script and the Get object? TGF2 does not have the Get object
It has the MOO objects, which can, a bit trickily, be used to communicate with a webserver. Good way to start is on Wikipedia! Search for GET or POST. ;)
And the Moo objects aren't supported in Flash :)
You can get an upgrade discount to MMF2 standard if you want to use the Get object.
Do actual Flash games (not the ones created with MMF) use the same way to store/read data? Or do they have other ways to access server-side data as well?
I think Flash is the same whether MMF2 or built with Flash in this respect.
Marv
You shoould just give a name to the file, like "myini.ini" in the properties.
is there an active picture object for mmf2 flash that loads images from the web!?? where is this?? that would be awesome!Quote:
Originally Posted by LB
what would be a great ini system though, is modifying the online hiscore example to just store values by name etc.. i will probably try to do that soon, but i am not good with php and mysql..
I thought that I could use an INI file to load in level data to the MFA and then compile into a SWF, but I can't get it to work.
Is it only possible to create an INI at run-time from the SWF?
If so, how else would it be possible to load in level data? Do you have to access an external file on a server, or is there another way to load in data into the MFA and then compile into a SWF?
Cheers
Roberto
Can't test it right now, can we add inis or arrays as binary data or is this a problem for Flash builds?
No, there is no way of saving data in the protected Flash area from outside a Flash application, to my knownledge.
How about simply including it with the include external data option?
The external data option doesn't work reliably in normal standalones. But it would be great if you could use them with Flash instead of actual files. Do you think this is (or will be) possible, Francois?
What you save in the protected area is not files, it is objects with properties. And Flash documentation specifically asks to maike these objects small. So I do not know.
Just letting you know i've tested ini files.
They do work but while testing your game in mmf they wont.
I exported it as a swf, uploaded it and played it and the data was stored.
I then cleared my cookies and temp internet files and the data still existed.
I can't however find the ini file anywhere.
In your INI object set it's path to "Search for this.ini" and then you can use windows serach to search through hidden files and folders and system files and folders to find it. ;)Quote:
Originally Posted by jasonorme
I think users wouldn't mind keeping things small (at least its better than nothing at all). Is it possible to have some sort of "virtual file" (memory-based) that MMF2 delegates to when any file action is performed?Quote:
Originally Posted by Francois
Wait, does that mean that you guys are considering on adding the function to read and write to INI files on a webserver? That would be AWESOME.
Some of us are a little stupid with PHP and mySQL. :P
No, because that function isn't possible.