setBackground(rand(0,0xFF),rand(0,0xFF),rand(0,0xFF)); $movie->setRate(31); $movie->setDimension(550,400); // draw unfilled circle shape $csize=60; $circle = new SWFShape(); $circle->setline(2,170,170,220); $circle->drawCircle($csize); // add circle shape to sprite $sp = new SWFSprite(); $f1=$sp->add($circle); $f1->moveto(0,$csize/2); $sp->nextframe(); // add circle sprite to holder sprite // nextframe each time to produce animation $clips=array(); $holder = new SWFSprite(); for($i=0;$i<12;$i++){ $clips[$i]=$holder->add($sp); $clips[$i]->moveTo(275,200); $clips[$i]->rotateto(30*$i); $holder->nextframe(); $holder->nextframe(); } // add a pause for($i=0;$i<44;$i++){ $holder->nextframe(); } // now remove the circle sprites from holder sprite // nextframe each time to produce animation for($i=0;$i<12;$i++){ $holder->remove($clips[$i]); $holder->nextframe(); $holder->nextframe(); } // add holder sprite to movie and give it an instance // name for actionscript to refer to it $f1=$movie->add($holder); $f1->setname("mc"); // some basic as to control the holder sprite // referred to as 'mc' in the actionscript $strAction=" controls = { onMouseDown: function () { mc._xscale=mc._yscale+=2; },onKeyDown: function () { mc._xscale=mc._yscale-=2; }}; Mouse.addListener(controls); Key.addListener(controls); onEnterFrame=function(){ mc._x=_xmouse-275; mc._y=_ymouse-200; }; "; // add the actionscript to frame 1 of the movie and save... $movie->add(new SWFAction( $strAction)); // save swf with same name as filename $swfname = basename(__FILE__,".php"); $movie->save("$swfname.swf",9); ?>