Using Datafiles
This page explains how to specify the name and/or location of the datafile you want to use with an applet. As we explain in the first section below, most of the time you don't need to bother about this. However, if you want to use the same applet several times using different datafiles, you must tell the applet where to find the datafile.
1. The Easy Way
Give your datafile the same name as the applet file, but with a .INF extension. So, if the applet file is named CoolStrip.swf, name your datafile CoolStrip.inf. Put the datafile in the same directory as the applet file. By default, the applet looks for a .INF file with the same name, so it will find this file and read it.
2. Using More Than One Datafile
If you want to use an applet with different datafiles on different pages, you must tell the applet where to find the datafile. You can call the datafiles whatever you like, but don't use spaces in the name. (We recommend using a .INF extension, but you can use .TXT if you prefer.) Put the datafiles in the same directory as the applet file.Let's assume you are using an applet file called CoolStrip.swf with a datafile called mydata.inf. In the HTML code that loads the applet, do this:
By adding the ?datafile=datafile-name after the name of the applet file, you are telling the applet to load its data from a file with this name which is in the same directory as the .SWF file.
3. Putting Datafiles In Different Directories
It's easiest to always put the datafiles in the same directory as the .SWF files. We can't really see a good reason to put them in a different directory, but if you need to do that, you can. However, the datafiles MUST be located on the same server as the .SWF file that loads them.Just make the same changed to the MOVIE parameter and SRC attribute shown above, but include the path to the datafile along with its name. If you include a relative URL to the datafile (such as ?datafile=../../datafiles/mydata.inf) there are two important rules to follow:
|