a Tuesday feature

by William Hurley

Shockwave Q&A

This week several of you sent mail asking me questions about the "gotonetpage" command and the different ways it could be used. As usual I am more than happy to answer readers' questions, so this week I'll answer several questions before moving on to our plans for next week.

How Can I Make a Shockwave Clickable?

This is a very simple question, and although we have touched on it in previous columns, perhaps it is time to cover it again. To make an object in your Shockwave movie clickable you will need to use the gotonetpage Lingo command. This will tell Lingo that you would like to load the URL that follows in the statement. For example, look at the following command:

on mouseDown
gotonetpage "http://www.whatever.com"
end

The on mouseDown tells us that the action will be executed when the mouse is clicked. If this were in a cast member script, it would execute when the cast member was clicked on. The next part of the script tells us that we would like to load the URL "http://www.whatever.com" in our browser. This means that when we click on the cast member, the browser will go to "http://www.whatever.com."

Do I Have to Type "http://www.whatever.com," or Can I Also Input "/whatever.html"?

Yes, you can (although I haven't seen enough people doing it) include only the name of the HTML document you would like to load in your Shockwave. There are, however, a few simple rules you should remember. Let's take a look at some examples.

Example 1

on mouseDown
gotonetpage "new.html"
end

This tells us that the page we want to load is in the same directory as the current Shockwave movie. This means that if the page "new.html" is not in the same directory the user will get an error when trying to load the page.

Example 2

on mouseDown
gotonetpage "/new.html"
end

This tells us that the page we want to load is one directory up from the directory our Shockwave movie is currently in. This means that if we have a directory named "2" and inside it is a directory named "3," then our current Shockwave movie is in the directory named "3," while our page we would like to load is in directory "2."

Keep in mind that you will find that Shockwave follows basic Internet protocol. Make sure you have your path names correct, and keep path names in mind when you are troubleshooting your Lingo.

How Can I Make the Page Open in Another Frame?

The almighty frame--well, although I have heard many people say that this can't be done, would Macromedia let us down and not include a way to use frames in the latest version of Shockwave? No. To use frames you simply add the Target by putting a "," after the page and then putting the target into the script. A Lingo script that uses Target frames would look like this.

on mouseDown
gotonetpage "new.html" , "paneltwo"
end

This command is very similar to our previous example, except now we have designated a Target frame for the page to be loaded into. The "paneltwo" is the Target frame in this case. Remember try using regular frames to get the hang of it before you try putting Lingo into Shockwaves to achieve the same effect.

Until next week . . .

Past installments of Simply Shocking

http://www.internet.com/