setDimension(600,400); $movie->setBackground(rand(0,0xFF),rand(0,0xFF),rand(0,0xFF)); $movie->setRate(31); $strAction = " // make an object and attach actions sketchpad = { onMouseDown: function () { draw=true; moveTo(_xmouse, _ymouse); }, onMouseUp: function () { draw=false; }, onMouseMove: function () { if (draw) { lineStyle(9, 255, 100); lineTo(_xmouse, _ymouse); } }, onKeyDown: function () { clear(); } }; // add listeners to object Mouse.addListener(sketchpad); Key.addListener(sketchpad); "; $movie->add(new SWFAction($strAction)); // save swf with same name as filename $swfname = basename(__FILE__,".php"); $movie->save("$swfname.swf",9); ?>