setRate(16); $movie->setDimension(550,400); $movie->setBackground(rand(0,0xFF),rand(0,0xFF),rand(0,0xFF)); $movie->add(new SWFAction(" controls={ onMouseDown:function(){ if(stopped){ _root[mc].play(); stopped=false; }else{ _root[_root.mc].stop(); stopped=true; } updateAfterEvent(); } }; Mouse.addListener(controls); Key.addListener(controls); ")); $num=20; $fontpath="Webdings.fdb"; $f=new SWFFont($fontpath); $fo=array(); $orig=array("to ","moveto","lineto","curveto", " "); $new=array("to\n","movepento","drawlineto","drawcurveto", ","); for($n=0;$n<$num;$n++){ $str=$f->getShape(65+$n); $newstr=str_replace($orig,$new,$str); $fo[$n]=explode("\n",$newstr); } for($n=0;$n<$num;$n++){ $sp=new SWFSprite(); $sp->add(new SWFAction("_root.stop();_root.mc='letter'+\"$n\";")); $colr=rand(50,255); $colg=rand(50,255); $colb=rand(50,255); $ln=rand(3,8); for($s=0;$ssetLine($ln,$colr,$colg,$colb); eval($mpto); $drawcode='$sh->'.$fo[$n][$s].'('.$fo[$n][$s+1].');'; eval($drawcode); $f1=$sp->add($sh); $sp->nextframe(); $nums=explode(",",$fo[$n][$s+1]); if($fo[$n][$s]!='drawcurveto'){ $mpto='$sh->movepento'."($nums[0],$nums[1]);"; }else{ $mpto='$sh->movepento'."($nums[2],$nums[3]);"; } } for($f=0;$f<6;$f++){ $sp->nextframe(); } $sp->add(new SWFAction("_root.play();")); $sp->nextframe(); $f1=$movie->add($sp); $f1->moveto(100,250); $f1->scaleto(0.3,0.3); $f1->setname("letter".$n); $movie->nextframe(); $movie->remove($f1); $movie->nextframe(); } $movie->nextframe(); // save swf with same name as filename $swfname = basename(__FILE__,".php"); $movie->save("$swfname.swf",9); ?>