Second step: The JavaScript
Here I cheated. I used Dreamweaver's built in show/hide layers script and just threw it in the head of the page.
Whether it's your own JavaScript, one you've pulled from a script archive or a pre-prepared one such as Dreamweaver's, you now have a means to switch layers on and off. Using this script I quickly wrote my own simple JavaScript function that would do what I wanted. My model in the diagram on the previous page is actually more simple than the finished site. I actually had to activate three layers at once - the content and two layers containing the graphics for up and down arrows that scroll the content layer, all of which I wanted hidden until the end of the movie. Rather than have four different bits of ActionScript in the Flash timeline, I created a JavaScript function that would show all of these layers at once:
Dead simple! As you can see, all I'm doing is making a function thatruns the Macromedia script once for each layer I want to show. There'salmost certainly a tidier way of doing it than this, but I'm no great JavaScript programmer.
Third step: Operating the function from Flash
This is the easiest step of all. Put this in the timeline of your Flashmovie at the point where you want the text content layer to appear:
getURL("javascript:showLayers()");
And that's that! You now have a layer in a HTML page that is hidden atfirst and made visible by a Flash movie at the appropriate time. There'sone problem though. This is a nice piece of eye candy the first time peoplesee it, but you don't want to irritate your users by making them sit throughit every time before they can even get a telephone number for example. Here was my solution.