The arrival or entry page for our class Web site demonstrates some moderately sophisticated design approaches combining Flash, ActionScript, and HTML. Now that you've all picked up a basic understanding of Flash, it seems reasonable to discuss these approaches, as they may provide starting points for your thinking about later assignments.
Layout and basic components
As you can see if you View Source, the primary markup for the entry page (index.htm) contains a simple frameset with two rows, each of which has a single frame within it. The first frame, marked (a) in the diagram, holds a page called splash.htm, which for the sake of convenience is stored in a subdirectory called splash. This page has OBJECT and EMBED containers that refer to a Shockwave movie called splash.swf. This movie plays when the page is loaded, displaying the title animation. It also contains the "MORE" button, marked (b) in the diagram. More about "MORE" below.
The second row and cell hold a page called startText.cfm, marked in the diagram as (c). That special file extension indicates that the page uses Allaire ColdFusion for one of its components, the weekly-updated link list that appears on the left. This feature has nothing to do with Flash.
You'll notice in the diagram a fourth component, marked (d). This one may look a bit mysterious, since it seems to designate a blank line at the bottom of the second frame. In fact a second Shockwave movie is included at this point, but it has no visible content (other than a white line which matches the page background). This stealthy movie is called sounder.swf; it's responsible for the sound clip that plays each time you load the entry page. I'll have more to say about this feature as well.
The "MORE" button
If you mouse over the red diamond marked (b) in the diagram, it will reveal the word "MORE". Clicking this button replaces the contents of the top frame, currently the page splash.htm, with another page selected at random.
The random selection depends on a very simple ActionScript command called random(x), where X is a non-zero integer that defines a range between zero and itself. So random(7) will generate a random number between 0 and 6, random(32) gives back something between 0 and 31, and so forth. The script attached to the "MORE" button tests the value of this random number against a series of if conditions and performs a getURL() command to load a new page in place of splash.htm.
These new pages contain brief Flash and QuickTime movies meant to serve as teasers and proofs-of-concept. Later in the course I will post further discussion of these projects, some of which exhibit advanced Flash techniques. For the moment it's enough to know that each of these movies contains some mechanism--either a frame action within a Flash movie or a META refresh in the hosting page for QuickTime movies--that calls splash.htm back into the top frame.
The random sound selector
Note that no sound clip plays when the splash movie comes back. This is because the sound controller, sounder.swf, resides in the lower frame, which is not reloaded.
The first frame of sounder contains a script similar to the one attached to the "MORE" button. It uses a random number to select one among several Shockwave movies, each of which contains a sound clip. Like sounder.swf, the visible content of each of these movies is a blank line, so the user never sees this transition take place.
Unlike the script for the "MORE" button, the script for sounder.swf uses the loadMovie command instead of getURL. This is a simpler design (you only need a set of Shockwave movies, not a set of movies plus a set of Web pages to host them), and since I don't want the second frame to reload, it works just fine.
I use the more complicated getURL technique in the upper frame because I want to include QuickTime movies that will depend on HTML rather than ActionScript for the transition back to splash.htm.
Source files
I've uploaded current versions of the source files for splash and sounder to multimediaShare/entryPage on Crow. Open these files to examine the action scripts discussed above.
