<?
// Convert SWF Drawing API data to Static SWF
// Example by Jerry Jasuta
// grab the drawing data
$data=$HTTP_POST_VARS["data"];
// create movie for swf output
// and set it's attributes
$movie=new SWFMovie();
$movie->setDimension(300,200);
$movie->setBackground(255,255,255);
// create the shape to hold our lines
$s=new SWFShape();
$s->setLine(1,0,0,0,255);
// split up the drawing data into lines
$lines=explode("-",$data);
// loop through the lines
for($l=0;$l<count($lines)-1;$l++){
// split up the line data
$lineData=explode("_",$lines[$l]);
// draw the line image
$s->movePenTo($lineData[0],$lineData[1]);
$s->drawLineTo($lineData[2],$lineData[3]);
} // end drawing data loop
// add the shape to the stage
$movie->add($s);
// save the movie to file
$movie->save("created.swf");
// print out the hmtl page
$revitalizer=rand();
print "<html>
<head>
<title>SWF Drawing Converted To Static SWF Using PHP and Ming</title>
</head>
<body bgColor='cccccc'>
<center>
SWF Drawing Converted To Static SWF Using PHP and Ming<p>
<OBJECT BORDER=1 classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0\" ID=objects WIDTH=\"300\" HEIGHT=\"250\">
<PARAM NAME=movie VALUE=\"created.swf?$revitalizer\">
<EMBED src=\"created.swf?$revitalizer\" WIDTH=\"300\" HEIGHT=\"250\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">
</OBJECT>
</center>
</body>
</html>
";
?>
Free Hosting Provide By: Web Hosting Service http://www.hostrocket.com
Make $50 Per Sale: VoIP Affiliate Program http://affiliates.viatalk.com
ViaTalk: Internet Phone Service http://www.viatalk.com