Now that you know how to make a button that your visitors can click like a link, let's learn how to make a splash page that will act as a redirect.

Actions can be added to frames of your movie much like they can be added to buttons. Let's create an animation using what we have learned to date, and on the final frame of the movie, let's add a redirect to a URL.

A) Begin as always by starting your HTML page and opening the php code block, I set the page's background to black to make the movie appear as the page itself.

<body bgColor="#000000">

B) Next, since we are using action scripting, we must set our version to Flash4 for WebTv users


C) Next, we add text using Trebuchet_MS font (or shapes if you like) to our movie as always

$myFont=new SWFFont("Trebuchet_MS.fdb");
$myText1=new SWFText();

D) Now we define our movie and set it's attributes as usual

$myMovie = new SWFMovie();

E) Next, we add an instance of our text (or shape) to our movie, moving it into position and manipulating it as we desire


F) Next, we create our animation or other "splash" effect as desired

for($i=0; $i<60; $i++){
for($i=0; $i<15; $i++){
for($i=0; $i<20; $i++){
for($i=0; $i<40; $i++){

G) Now, we create our redirect using action scripting added to the next movie frame

$myMovie->add(new SWFAction("getURL
('', '_top');"));

H) Finally, we save our movie, close our php code block, and add our object coding as usual, before closing our html document


<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=",0,0,0" ID=objects WIDTH=460 HEIGHT=80>
<PARAM NAME=movie VALUE="lesson12.swf">
<EMBED src="lesson12.swf" WIDTH=460 HEIGHT=80 TYPE="application/x-shockwave-flash" PLUGINSPAGE="">

Next lesson, we will learn to use action scripting to animate.

Code summary for lesson 12:


Click for WebWizard Ways!