Dynamic Parameters

A Flash applet normally loads its parameters from a static file on the server (we refer to it as a datafile). That's fine for most uses, but what if you want to display different content in the applet for different users, or populate a menu from a database that changes regularly?

With Cool Focus applets this is easy to do, with some knowledge of a server-side scripting language such as ASP, PHP or JSP.

By default, each applet will load a datafile whose name matches its own; for example, Messenger.swf will load a datafile named Messenger.inf placed in the same directory. You an specify a datafile with a different name by tagging it onto the SWF filename in the <object> and <embed> tags like this:

Messenger.swf?datafile=MyData.txt
Using the same method, you can instead set the datafile to point to an ASP/PHP/JSP script:
Messenger.swf?datafile=MyData.asp
The script then simply constructs the list of parameters to pass back to the applet, using any of the resources available to the script, such as database access.

The simple example below shows Messenger using dynamically-created parameters to display two items: the date and time at which the parameters were generated. If you right-click and refresh the page, you'll see these update.

For more information, read article #17 in our Knowledge Base.