setBackground(rand(0,0xFF),rand(0,0xFF),rand(0,0xFF)); $movie->setRate(31); $movie->setDimension(550,400); //// easing equation converted to php from Actionscript @ // http://www.robertpenner.com/easing_equations.as // use of which are subject to the license @ // http://www.robertpenner.com/easing_terms_of_use.html function easeInQuad ($t, $b, $c, $d) { $t/=$d; return $c*$t*$t + $b; }; function easeOutQuad ($t, $b, $c, $d) { $t/=$d; return -$c *($t)*($t-2) + $b; }; // basic actionscript control of playback using mouse $strAction=" if(!init){ init=true; stopped=false; controls = { onMouseDown: function () { if(!stopped){ stop(); stopped=true; }else{ play(); stopped=false; } } }; Mouse.addListener(controls); } "; $movie->add(new SWFAction($strAction)); // grab the jpgs $f = array(); for($i=0;$inextFrame(); for($i=0;$iadd($img); $pic->moveTo( (275-$img->getwidth()/2),(200-$img->getheight()/2)); $transition=20; $cnt=1; $startpos=0; $offset=1; $duration=$transition; while($cnt<=$duration){ $inc=easeInQuad ($cnt++, $startpos, $offset, $duration); $pic->multColor(1,1,1,$inc); $movie->nextFrame(); } for($j=1;$j<=$transition*2;$j++){ $movie->nextFrame(); } $cnt=1; $startpos=1; $offset=-1; $duration=$transition; while($cnt<=$duration){ $inc=easeOutQuad ($cnt++, $startpos, $offset, $duration); $pic->multColor(1,1,1,$inc); $movie->nextFrame(); } $movie->remove($pic); } } $movie->nextFrame(); // save swf with same name as filename $swfname = basename(__FILE__,".php"); $movie->save("$swfname.swf",9); ?>