setRate(31); $movie->setDimension(550,400); $movie->setBackground(rand(0,0xFF),rand(0,0xFF),rand(0,0xFF)); // create a box $boxwidth=200; $boxheight=200; $box=new SWFShape(); $box->setRightFill(255,0,0); $box->drawLine($boxwidth,0); $box->drawLine(0,$boxheight); $box->drawLine(-$boxwidth,0); $box->drawLine(0,-$boxheight); $sp=new SWFSprite(); $sp->add($box); $sp->nextFrame(); $f1=$movie->add($sp); $f1->setName("box"); // create an actionscript string $strAction=<<add(new SWFAction($strAction)); // save swf with same name as filename $swfname = basename(__FILE__,".php"); $movie->save($outswf="$swfname.swf",9); // open movie and set version to 8 // (hack until it can be set in ming) $ftmp=fopen($outswf,"r"); $stmp=fread($ftmp,filesize($outswf)); $ftmp=fopen($outswf,"w"); fwrite($ftmp,substr_replace($stmp,chr(8),3,1)); ?>