This week we will discuss a few of the commands available for interaction with the Internet and the when, where, and how to using them in Shockwave projects. This will also serve as prerequisite information for the next project we will build, which will involve a marketing solution that can be seen by customers over the Net by downloading it in several sections. The project includes several techniques that we have not yet covered. When to Use What Command
So let's now look at two of the commands available for interaction with the Internet, what they do, the differences between them, and how we can use them in our projects.
preloadNetThing
This command preloads an HTTP item into the NetScape disk cache so it can be used later without a download delay.
The HTTP item can be anything, including a Director movie, an HTML page, a graphic, and so on. The command is very useful when used with large Director files. It allows you to break the file up into smaller parts, and then have the next part (in sequence) download in the background over the Internet.
When using this command in a Shockwave, the current movie will continue playing while preloading of the next Shockwave takes place in the background. You can use the netDone Lingo command to find out when preloading is finished. Once you've preloaded an item, it can be displayed immediately since it's taken from the local disk cache rather than from the network. It is important to understand that, when using the preloadNetThing command, it's impossible to determine when an item may be removed from the local disk cache--without it the users' ease of use is in jeopardy.
gotoNetMovie uri
This command retrieves and goes to a new shocked Director movie from the network. The current movie continues to run until the new movie is available.
This is just as useful as the preloadNetThing; however, when the new movie arrives, the plug-in quits the current movie without warning and starts to play the new one. The new movie occupies the same display area as the calling movie. This command can be useful for breaking larger projects into several smaller pieces. In future projects we will look at the logistics needed to use this command.
In both commands the uri (universal resource identifier) parameter identifies the HTTP item containing the movie. In other words, you are simply putting in information that will result in Shockwave guiding the browser to a new URL location. This is a simple explanation. But if you think of both of these commands in this way, it will make it easier to understand future tutorials.
At present, only HTTP URLs are supported as valid uri parameters. The URL can specify either a filename or an anchor within a file. For example, both of the following URLs are valid:
- http://www.myserver.com/movies/first.dcr
- http://www.myserver.com/movies/buttons.dcr#Contents
Remember, if a gotoNetMovie operation is in progress and you issue a second gotoNetMovie command before the first is finished, the second command will cancel the first command out.
Next week we will cover an example that uses these commands. Until then, just send mail if you have any questions.