setRate(16); $movie->setDimension(550,400); $movie->setBackground(rand(0,0xFF),rand(0,0xFF),rand(0,0xFF)); // grab font outlines & amend format & store in $fontoutlines $num=20;//223; // number of 'letters' to draw $offset=98;//33; $fontpath="Webdings.fdb"; $f=new SWFFont($fontpath); $fontoutlines=array(); for($i=0;$i<$num;$i++){ // $fostring format is: $fostring=$f->getShape($offset+$i); // curveto 10,10 20,20\n $fostring=str_replace("\n",":",$fostring); // curveto 10,10 20,20: $fostring=str_replace("to ","to:",$fostring); // curveto:10,10 20,20: $fostring=str_replace(" ",",",$fostring); // curveto:10,10,20,20: // save $fostring into $fontoutlines array $fontoutlines[$i]=$fostring; } // copy $fontoutlines into the actionscript $strAction="fontoutlines=[];i=0;offset=$offset;"; for($i=0;$i<$num;$i++){ $strAction.=" fontoutlines[i++]=\"$fontoutlines[$i];\"; "; } // adding actionscript to draw 'letters' to $strAction $strAction.=" // split fontoutlines fontoutlinessplit=[]; for(i=0;i=a.length){ // if the 'letter' is drawn move to next letter n=(++n%fontoutlines.length); this.clear(); i=0; }else{ // there are still lines to draw mc.lineStyle(6,0xffaaaa,100); var coords=a[i+1].split(','); // split the coordinate data if(a[i]=='curveto'){ // curveto has 4 coordinates mc[a[i]](coords[0],coords[1],coords[2],coords[3]); }else{ mc[a[i]](coords[0],coords[1]); // lineto/moveto have 2 coordinates } i+=2; // move to next command/coordinate pair } } }; // simple playback control using mouse controls = {onMouseDown: function () {draw=!draw;}}; Mouse.addListener(controls); // add text box showing current font number this.createTextField('txt',9999,10,380,30,20); txt.multiline = true; txt.wordWrap = true; //txt.border = true; txt.type = 'dynamic'; // make textformat myformat = new TextFormat(); myformat.color = 0xffaaaa; myformat.size = 14; myformat.font = '_sans'; myformat.bold = false; txt.setTextFormat(myformat); "; // add actionscript to frame 1 $movie->add(new SWFAction($strAction)); // save swf with same name as filename $swfname = basename(__FILE__,".php"); $movie->save("$swfname.swf",9); ?>