Scripts
Finally, after all the project planning and other assorted notes, we are ready to look at the first completed sections of the project.
The project has been complete since the second week, but since so many steps are involved in its creation, we have been working with it in various stages. This week we look at Stage I, which is the complete project minus the text objects and links to .html pages on the internet.com site.
Stage I: Scripts
The first thing we want to look at is the Lingo scripting that went into this stage of the project. As we have mentioned in previous columns, we want to make use of the doubleClick command as well as the single-click statements so that we could add different functionality to the project's user interface.
The doubleClick Lingo Command
In our cast we applied the doubleClick command to the cast member that appears at frame 1 (the internet.com interface logo). The script used the following syntax:
<>
on mouseDown
if the doubleClick then go to frame 2
end
This command is very straight-forward; however, it seems to fall through the cracks when most people are designing Director-based projects. In our interface design, we wanted to use the doubleClick to open the interface and the single click to close the interface. At the bottom of this page is the Shockwave file for Stage I. Try clicking once on it (nothing will happen). After this, try clicking twice. Doing this will open the interface. To display where the text will be, we have placed "index.html" as a placeholder. Next week all the text will be added to this Shockwave and we will be able to use the final interface.
The Visible of Sprite Lingo Command
We have used (and explained) this command in previous columns; however, this week I wanted to discuss the use of this command, so in the project we used it in two different ways. Let's take a look at each way this command is used in the project.
The first time I used the command I did what many Director users do by using the following syntax:
on enterframe
if rollover (1) then
set the visible of sprite 2 to true
else set the visible of sprite 2 to false
end if
end
Notice that the rollover is used in relation to sprite 1. This means that when the mouse moves over sprite 1 (the logo), sprite 2 will become visible. Many people are not aware that sprites can be used in rollover statements (as well as many others), regardless of whether they are visible to the user. For example, the second rollover script performs the same function, except this time the rollOver is set for sprite 2 (the red highlight).
on enterframe
if rollover (2) then
set the visible of sprite 2 to true
else
set the visible of sprite 2 to false
end if
endMany of you may know these tricks, but when I am brought in to look at a Director project, many people ask me why I change things. Most of the questions are usually about the scripts we have discussed in this column.
The doubleClick command is all too simple, but its use can help to design better interfaces for your users. One of the main reasons to use it on a project like this is that the navigation system is trying to imitate the functionality of an application. Can you single click an application on the Macintosh platform and have it start? Can you do the same on the Windows side? These are the things that make simple Director projects great for the end-user by sticking to some of the features and functionality they are use to.
Next week we will look at the rest of this project. Barring any questions about this week's column we will finish this project and move on to greater Shockwave pandemonium. Until then, if you have any questions, just send me some mail. By the way, comments about the column are also welcome.