setDimension($movieWidth,$movieHeight); $movie->setBackground(rand(0,0xFF),rand(0,0xFF),rand(0,0xFF)); $movie->setRate($movieFrameRate); $movie->nextFrame(); $movie->nextFrame(); $movie->nextFrame(); // $stream = new SWFVideoStream(); $stream->setDimension($videoWidth, $videoHeight); $item = $movie->add($stream); $item->moveTo($videoXPos, $videoYPos); $item->setname("video"); // $strAction=<<videoLength="+videoLength); }; stream.onStatus = function() { trace("stream.onStatus>this.time="+this.time); if (this.time > 0 && this.time >= (videoLength-0.1)) { trace("video ended so restarting..."); this.pause(true); this.seek(0); this.pause(false); } }; EOT; // $movie->add(new SWFAction($strAction)); $movie->nextFrame(); // // save swf with same name as filename $swfname = basename(__FILE__,".php"); $movie->save("$swfname.swf",9); ?>