Posted by Miss Jones in SWF Studio V3 on Jan 28 2008, 02:35 am

Hello, I am making an educational application with Flash. I have already been able to use swf studio to load data from xml files into my app using the filesys plugin as well as a couple of other things that make it work beautifully, but I'm a little slow learning the scripting. The next thing I want to try is using the inifile plugin to save user data.

Basically I am trying to create a welcome screen that lets the user type in her name and password, then she goes to the main page where, among other things, she may choose to go to a "report card" page that lets her see what is already done.

The help page shows this format for ini files:


What I want to do is have something like this:

Name2=value etc

So every time a new user signs in, that person would get assigned a new section, ad infinitum. Can I do that? If so, then when the app starts, I would want it to load the returning user names into a drop down menu, so a returning user can click on his own name and continue.

If anyone knows of a tutorial that could get me started on this, it would be a great help. The other thing I thought of doing was adapting the format I already used with XML files for loading the application data so that it handles user data as well. I am not sure what the best thing to do here is, but I thought using an ini file is the usual approach.

Any suggestions would be greatly appreciated.
Thanks from a Newbie!!

Posted by mbd in SWF Studio V3 on Jan 28 2008, 11:04 am

The INIFile plugin can do what you want. You specify what you want to store using ssCore.INIFile.setVal. In that command you specify the section (the value that will be wrapped in [], but don't specify [] in the value), the key and the value.

From your example:

ssCore.INIFile.setVal({path:"startdir://settings.ini", section:"User1", key:"Name", value:"Value"});

You don't have to specify a number after the key. It will be unique because it belongs to a section. Although, there's no reason why you can't use a number as well.

Each consecutive call you make to setVal with the same section will just add the value to the section.

To get a list of all sections use ssCore.INIFile.enumSections. That will return a list of sections in the INI file you specify. The list will be a string that you will probably need to convert to an Array.

Posted by Miss Jones in SWF Studio V3 on Jan 28 2008, 11:32 pm

That's a big help. I'm going to work my way through it today.