setDimension(550,400); $movie->setBackground(rand(0,0xFF),rand(0,0xFF),rand(0,0xFF)); $movie->setRate(12); // draw a shape with a white fill $s=new SWFShape(); $s->setRightFill(255,255,255); $s->movePenTo(-50,-50); $s->drawLine(50,-20); $s->drawLine(50,20); $s->drawLine(20,50); $s->drawLine(-20,50); $s->drawLine(-50,20); $s->drawLine(-50,-20); $s->drawLine(-20,-50); $s->drawLine(20,-50); // create a sprite, add shape to it, add sprite to movie, // move it to _x=275 _y=200 $sp= new SWFSprite(); $f1 = $sp->add($s); $sp->nextFrame(); $clip=$movie->add($sp); $clip->moveTo(275,200); // add onClipEvent actions to clip sprite (Flash 5 syntax) $clip->addAction(new SWFAction("loadVariables('colvar.txt',this);dir=5;function run(){this._rotation+=dir;};"),SWFACTION_ONLOAD); $clip->addAction(new SWFAction("run();"), SWFACTION_ENTERFRAME); $clip->addAction(new SWFAction("startDrag('');"), SWFACTION_MOUSEDOWN); // compiled using this line //$clip->addAction(new SWFAction("this.startDrag();"), SWFACTION_MOUSEDOWN); // may need this version now $clip->addAction(new SWFAction("stopDrag();"), SWFACTION_MOUSEUP); $clip->addAction(new SWFAction("dir=-5;"), SWFACTION_KEYDOWN); $clip->addAction(new SWFAction("dir=5;"), SWFACTION_KEYUP); $clip->addAction(new SWFAction("oldX=X;oldY=Y;Y=_parent._ymouse;X=_parent._xmouse;_x+=(oldX-X)/50;_y+=(oldY-Y)/50;"),SWFACTION_MOUSEMOVE); $clip->addAction(new SWFAction("col=new Color(this);col.SetRGB(clipcolor);"), SWFACTION_DATA); // save swf with same name as filename $swfname = basename(__FILE__,".php"); $movie->save("$swfname.swf",9); ?>