setDimension(550,400); $movie->setBackground(rand(0,0xFF),rand(0,0xFF),rand(0,0xFF)); $movie->setRate(12); // drawing a red square shape (registration point : centered) $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); // make a movieclip (sprite) and add the red square to it $squareSprite= new SWFSprite(); $f2 = $squareSprite->add($squareshape); $squareSprite->nextFrame(); // add red square movieclip (sprite) to the movie // and move it to to _x=100 _y=100 and name it "mc" $ss=$movie->add($squareSprite); $ss->moveTo(100,100); $ss->setName("mc"); // write actionscript to duplicate the movieclip (sprite) // and move the new clip and change its color to orange $strAction=" mc.duplicateMovieClip('mc1',5); mc1._x=250; mc1._y=100; col = new Color(mc1); col.setRGB(0xFF6600); "; // add actionscript to frame #1 of the movie $movie->add(new SWFAction($strAction)); // save swf with same name as filename $swfname = basename(__FILE__,".php"); $movie->save("$swfname.swf",9); ?>