setDimension(550,400); $movie->setBackground(rand(0,0xFF),rand(0,0xFF),rand(0,0xFF)); $movie->setRate(31); // draw a red square and put it on the stage $squareshape=new SWFShape(); $squareshape->setRightFill(255,0,0); $squareshape->movePenTo(-50,-50); $squareshape->drawLine(100,0); $squareshape->drawLine(0,100); $squareshape->drawLine(-100,0); $squareshape->drawLine(0,-100); $squaresymbol=$movie->add($squareshape); $squaresymbol->moveTo(250,200); // rotate red square for($i=0; $i<50; $i++) { // rotate is cumilative as opposed to rotateTo which // is absolute (so in this example the rotation // appears to speed up). also rotate plus is anti-clockise // and rotate minus is clockwise $squaresymbol->rotate($i); $movie->nextFrame(); } // save swf with same name as filename $swfname = basename(__FILE__,".php"); $movie->save("$swfname.swf",9); ?>