[Solved] saving user settings

Hello,

I have the PRO version of iScreensaver. I created a Flash screensaver with interactivity. I need the users’ settings to be stored so that when the screensaver starts up again, it runs using their past settings.

Is there a way to do this? I tried using a Shared Object which works but only when the swf runs alone but not when it is embedded in the screensaver. (I’ve tried both “Access Local Files” and “Access Network Files” set, but neither has any effect.)

Hi Adam – what version of Adobe Flash are you authoring in, what version are you saving in, and what version of Flash Player do you have installed?

I am authoring in Flash version 6 (actionscript 2). It’s old code, and if I try to publish it in later versions, it does not compile properly. I have the latest Flash Player installed.

Do shared objects normally work? If so, do you think the issue is that it is being published in Flash 6?

When iScreensaver executes your SWF file, it’s running it as a local file from your hard drive (with is the “local” context, not the “network” context), rendered in the OS’s web browser control (e.g. Safari/Webkit on osx, and IE on Windows).

So, to test, you should be able to simply load a small HTML file (which opens the SWF) in your web browser. You must use Safari on mac, or IE on windows for this test.

If the shared object doesn’t work in that test, then it suggests a problem in your SWF. If it does work, then it could be an issue with iScreensaver.

Please do the test and let us know what you find?

FYI, here’s a discussion of the whole flash security sandbox, which is fairly complicated. This is a bit dated, but covers the major changes that came about in Flash 8 and later:

http://www.adobe.com/devnet/flash/articles/fplayer8_security.html

The shared object was correctly created and saved when run from the html page. However, there is no shared object file being created when the screensaver is run.

I tried creating a really simple flash file (published in 10.2 with actionscript 2 on Windows) that creates a simple shared object. Again, when run as a swf it correctly saves the shared object, but nothing is saved when the swf is embedded as a screensaver.


this folder is created when the SCREENSAVER is run but is empty:
\AppData\Roaming\Macromedia\Flash Player\#SharedObjects\FU9J7AHY\localhost\Windows\TESTER Libs\

this folder is created when the SWF is run and CORRECTLY stores the shared object:
\AppData\Roaming\Macromedia\Flash Player\#SharedObjects\FU9J7AHY\localhost\Users\Adam\Desktop\tester.swf\myTesterSharedObject.sol


If you can figure out a fix for this it would be most helpful. I have a number of screensavers that need to store a users’ settings.

Thank you.

I believe I solved it. I added the optional path paramater to the getLocal method of the SharedObject.

I’ve coded it now as:

user = SharedObject.getLocal(“mySharedObject”, “/”);

By adding that second argument (the path), the shared object is created within the screensaver and the user settings are all saved now! Success at last! :slight_smile:

If anyone is interested in viewing this screensaver, it’s called Alien Fractal Glyphs and you can download it at GOscreensaver.com

Adam, that’s very cool that you discovered the issue, and we thank you for taking the time to post it here for others to use. :slight_smile:

Postscript: as a screensaver author, one should remember that the end-user does have the ability to disable all Flash Local Shared Objects using their Flash Preferences control panel.

Keep that in mind as you write your Flash screensaver with that in mind, so that it still functions sensibly even if the LSO is not available.