|
Datafile Reloading
In normal use, Messenger loads your datafile at startup, and this defines the styles, behavior and text-messages shown by the applet. The Datafile Reloading feature makes it possible to tell Messenger to restart using a different datafile in compatible browsers.. You might want to do this to display a different collection of text-messages.You can use this feature in two ways: either by using a link in the applet (so that the new datafile is loaded when the user clicks one of the text items) or using JavaScript.
Using a Link in the Applet
You can use a text item's URL parameter to open a datafile instead of opening a web link. The URL parameter should look like this:
URL3=datafile(mydatafile.inf)If the user clicks this link, the applet will load the datafile named "mydatafile.inf". It's important that the word datafile is lowercase, and there must be no spaces or quote symbols in the line. You can use an absolute or relative URL for the datafile name. If you use a relative URL, note that the location of the datafile is relative to the location of the SWF file (not the location of the web page).
Using JavaScript
You can also use JavaScript to force the applet to load a different datafile. This could be in response to a click on an ordinary HTML link, or to some other scripting event. To use this method, set the applet's newdatafile variable to the location of the datafile, as in this example function:
function loadDataFile(d)If you changed the name 'Messenger' in your HTML code, change the instances in the script code above so they match the new name you chose. You can use an absolute or relative URL for the datafile name. If you use a relative URL, note that the location of the datafile is relative to the location of the SWF file (not the location of the web page).
Another useful way to use this feature is to force the applet to reload the datafile automatically every few minutes. You might choose to do this if you regularly update the datafile to contain the latest news stories. The JavaScript setInterval() function can be used to call the above function at regular intervals while the user remains on the page.
|