Lesson 1 - Creating a plain SWF movieA) PHP can be placed directly in html documents, so begin with our normal html tags (the file may need to be named .php rather than .html, depending upon your server settings)
<html>
<body>
B) Next we use the php opening tag to begin our code:
<?php
C) Next, we create a new SWFMovie by creating an object set to the new movie:
$myMovie=new SWFMovie();
D) Now we can set the attributes of the movie object we created, such as the size and background color (colors are in rgb):
$myMovie->setDimension(460,80);
$myMovie->setBackground(255,0,0);
E) And finally we can save the swf we have created to a file, then
close off the php code section:
$myMovie->save("lesson1.swf");
?>
F) Now we use the standard flash object embed and param tags so that as many browser as possible can view our creation:
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0"
ID=objects WIDTH=460 HEIGHT=80>
<PARAM NAME=movie
VALUE="lesson1.swf">
<EMBED src="lesson1.swf" WIDTH=460 HEIGHT=80
TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</OBJECT>
G) And finally close off the html page:
</body>
</html>
Next lesson we will add various shapes to our newly created movie!
<html>
<body>
<?php
$myMovie=new SWFMovie();
$myMovie->setDimension(460,80);
$myMovie->setBackground(255,0,0);
$myMovie->save("lesson1.swf");
?>
<OBJECT
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0"
ID=objects WIDTH=460 HEIGHT=80>
<PARAM NAME=movie
VALUE="lesson1.swf">
<EMBED src="lesson1.swf" WIDTH=460 HEIGHT=80
TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</OBJECT> <br><a href="javascript:history.go(-1)"><
back</a>
</body>
</html>