setDimension(550,400); $movie->setBackground(rand(0,0xFF),rand(0,0xFF),rand(0,0xFF)); $movie->setRate(12); $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); // add the square to a sprite $sprite1 = new SWFSprite(); $clip1=$sprite1->add($squareshape); $sprite1->nextFrame(); // add the above sprite to another sprite $sprite2 = new SWFSprite(); $clip2=$sprite2->add($sprite1); // now rotate clip2 inside sprite2 $rotateSpeed=5; for($i=$rotateSpeed;$i<91;$i+=$rotateSpeed){ $clip2->rotateTo($i); $sprite2->nextFrame(); } // add one to movie $rotatingSquareClip=$movie->add($sprite2); $rotatingSquareClip->moveTo(200,200); // save swf with same name as filename $swfname = basename(__FILE__,".php"); $movie->save("$swfname.swf",9); ?>