14th April 2013, 12:08 AM
I am currently porting an project to Flash so I can host it on a webpage, and have a query about the GET Object and the Flash Exporter.
The game is an anti-phishing educational tool, it is for an experiment.
Previously, a set of example phishing URLs ("game data") was being loaded using an INI file. So, rather than rewriting the game such that it doesn't use an INI file for this purpose, I would like to use the existing INI file by loading it from a web-server. So in the new project, I am using the GET object to grab the existing INI file from my web-server and then using the EditText object to then save it as a local INI file. This works fine inside MMF, as shown below (retrieving the GET data as a string object):
However, when I export the project to SWF, the GET object only seems to be grabbing the first line of the INI file from the web server, as shown below:
Is this a limitation of the GET object? Is this a limitation of the String/Edit Text object in Flash? Is the Flash version of the GET object expecting the results in a more specific format? Or is there a better approach you could suggest?
Thank your for any assistance!
Edit: FYI, I modified the first group within the INI file for diagnostic purposes.
14th April 2013, 12:38 AM
GET object should work exactly the same in Flash, and I've done a lot of work using GET object to request rather large sets of data with no problem at all.
My guess is the problem is in the string/edit object.
Pay special attention to you string object. As far as I remember - in Flash - it doesn't resize itself to show all the lines, and thus could visually seem to only contain one line, when it actually contains all lines.
14th April 2013, 01:07 PM
So I've enlarged the string/edit object and I can see that the data *is* actually there. Thus, the GET Object is working as intended. However, the data itself does not seem to be making its way into the local .ini file.
Originally Posted by Burfelt
Is there anything particular about the way INI files are handled in Flash? Is there a limitation to the way the Flash handles saving data?
14th April 2013, 05:02 PM
I've had a play and come up with a rather more eccentric solution than I was hoping for. Essentially it seems that the ability to save files using EditText and StringParser are different in the Flash extension, so they were not producing the files that I was expecting them to. However, manipulating the INI file directly did result in a persistent save file. My solution was to reformat the ini file using "|" and "=" as delimiters. Then using a "fast loop" to repopulate the INI file directly using the INI object.
Originally Posted by Adrir
Ideally, I would like to maintain the structure of the INI file to make them easier to edit, so is there a way to use a line break as a delimiter in the StringParser (as similar to '\n' for Java)?
15th April 2013, 01:04 AM
Found it: NewLine$
Originally Posted by Adrir
Tags for this Thread