// masking jpgs : incomplete and undocumented but it works... // the idea is very simple : make a shape, add it to a sprite, // scale it to 0, tween it to scale to 1 over a number of frames, // use the sprite to mask a bitmap, post your code... // Original date: October 2003 @ www16.brinkster.com/gazb/ming/ // code by gazb : gazb dot ming at NOSPAM gmail dot com // http://www16.brinkster.com/gazb/ming/ setRate(31); $movie->setDimension(550, 400); $movie->setBackground(0x33,0x33,0x33); //}}} //{{{ get bitmaps $picarray=array("gimp3.jpg","gimp4.jpg","gimp5.jpg","gimp6.jpg","gimp8.jpg","gimp9.jpg","gimp10.jpg"); $bitmap=array(); $pathtojpgs="./"; for($i=0;$iadd($pic); $picsp->nextframe(); $bitmap[$i] =$picsp; } //}}} //{{{ function masktweenwipeLR function masktweenwipeLR($dur){ $dur=($dur)-2; $w=256+2; $h=256; $endscale= 1; $shape = new SWFShape(); $shape->setLeftFill(255,125,0); $shape->drawLine($w,0); $shape->drawLine(0,$h); $shape->drawLine(-$w,0); $shape->drawLine(0,-$h); // $sprite = new SWFSprite(); $sprite->add($shape); $sprite->nextframe(); // $sprite2 = new SWFSprite(); $f1=$sprite2->add($sprite); $f1->scaleto(0,1); $sprite2->nextframe(); // $cnt=0; while($cnt++<$dur){ $inc=easeInOutQuad ($cnt, 0, $endscale, $dur); $f1->scaleto($inc,1); $sprite2->nextframe(); } // $strAction = "stop();"; $sprite2->add(new SWFAction($strAction)); $sprite2->nextframe(); // return $sprite2; } //}}} //{{{ function masktweenwipeRL function masktweenwipeRL($dur){ $dur=($dur)-2; $w=256; $h=256; $endscale= 1; $shape = new SWFShape(); $shape->setLeftFill(255,125,0); $shape->drawLine($w,0); $shape->drawLine(0,$h); $shape->drawLine(-$w,0); $shape->drawLine(0,-$h); // $sprite = new SWFSprite(); $sprite->add($shape); $sprite->nextframe(); // $sprite2 = new SWFSprite(); $f1=$sprite2->add($sprite); $f1->scaleto(0,1); $f1->rotateto(180); $f1->moveto($w,$h); $sprite2->nextframe(); // $cnt=0; while($cnt++<$dur){ $inc=easeInOutQuad ($cnt, 0, $endscale, $dur); $f1->scaleto($inc,1); $sprite2->nextframe(); } // $strAction = "stop();"; $sprite2->add(new SWFAction($strAction)); $sprite2->nextframe(); // return $sprite2; } //}}} //{{{ function masktweenfromcenter function masktweenfromcenter($dur){ $dur=($dur)-2; $w=128; $h=256; $endscale=1; $shape = new SWFShape(); $shape->setLeftFill(255,125,0); $shape->drawLine($w,0); $shape->drawLine(0,$h); $shape->drawLine(-$w,0); $shape->drawLine(0,-$h); // $sprite = new SWFSprite(); $sprite->add($shape); $sprite->nextframe(); // $sprite2 = new SWFSprite(); $f1=$sprite2->add($sprite); $f1->scaleto(0,1); $f1->moveto($w,0); $f2=$sprite2->add($sprite); $f2->scaleto(0,1); $f2->rotateto(180); $f2->moveto($w,$h); $sprite2->nextframe(); // $cnt=0; while($cnt++<$dur){ $inc=easeInOutQuad ($cnt, 0, $endscale, $dur); $f1->scaleto($inc,1); $f2->scaleto($inc,1); $sprite2->nextframe(); } // $strAction = "stop();"; $sprite2->add(new SWFAction($strAction)); $sprite2->nextframe(); // return $sprite2; } //}}} //{{{ function masktweenfromedges function masktweenfromedges($dur){ $dur=($dur)-2; $w=129; $h=256;$seperation=256; $endscale= 1; $shape = new SWFShape(); $shape->setLeftFill(255,125,0); $shape->drawLine($w,0); $shape->drawLine(0,$h); $shape->drawLine(-$w,0); $shape->drawLine(0,-$h); // $sprite = new SWFSprite(); $sprite->add($shape); $sprite->nextframe(); // $sprite2 = new SWFSprite(); $f1=$sprite2->add($sprite); $f1->scaleto(0,1); $f2=$sprite2->add($sprite); $f2->scaleto(0,1); $f2->rotateto(180); $f2->moveto($seperation,$h); $sprite2->nextframe(); // $cnt=0; while($cnt++<$dur){ $inc=easeInOutQuad ($cnt, 0, $endscale, $dur); $f1->scaleto($inc,1); $f2->scaleto($inc,1); $sprite2->nextframe(); } // $strAction = "stop();"; $sprite2->add(new SWFAction($strAction)); $sprite2->nextframe(); // return $sprite2; } //}}} //{{{ function masktweencircle function masktweencircle($dur){ $dur=($dur)-2; $w=128; $endscale= 1*(1.5); $shape = new SWFShape(); $shape->setLeftFill(255,125,0); $shape->drawcircle($w); // $sprite = new SWFSprite(); $sprite->add($shape); $sprite->nextframe(); // $sprite2 = new SWFSprite(); $f1=$sprite2->add($sprite); $f1->scaleto(0.001,0.001); $f1->moveto($w,$w); $sprite2->nextframe(); // $cnt=0; while($cnt++<$dur){ $inc=easeInOutQuad ($cnt, 0, $endscale, $dur); $f1->scaleto($inc,$inc); $sprite2->nextframe(); } // $strAction = "stop();"; $sprite2->add(new SWFAction($strAction)); $sprite2->nextframe(); // return $sprite2; } //}}} //{{{ function masktweenclock function masktweenclock($dur){ $dur=($dur)-2; $sprite = new SWFSprite(); $cnt=0; while($cnt++<$dur){ if($cnt>1){ $sprite->remove($f1); } $inc=easeInOutQuad ($cnt, 0, 360, $dur); $shape = new SWFShape(); drawWedge ($shape,0,"cccccc","ff0000",0,0,0,$inc,256); $f1=$sprite->add($shape); // should prob remove previous one here $f1->moveto(128,128); $sprite->nextframe(); } $strAction = "stop();"; $sprite->add(new SWFAction($strAction)); $sprite->nextframe(); // return $sprite; } //}}} //{{{ function masktweenclockR function masktweenclockR($dur){ $dur=($dur)-2; $sprite = new SWFSprite(); $cnt=0; while($cnt++<$dur){ if($cnt>1){ $sprite->remove($f1); } $inc=easeInQuad ($cnt, 0,-360, $dur); $shape = new SWFShape(); drawWedge ($shape,0,"cccccc","ff0000",0,0,0,$inc,256); $f1=$sprite->add($shape); $f1->moveto(128,128); $sprite->nextframe(); } $strAction = "stop();"; $sprite->add(new SWFAction($strAction)); $sprite->nextframe(); // return $sprite; } //}}} //{{{ function masktweenstar function masktweenstar($dur){ $dur=($dur)-2; $w=128; $endscale= 1*(1.5); $shape = new SWFShape(); $shape->setLeftFill(255,125,0); // drawStar($shape,$lw,$lc,$sc,$x, $y, $points,innerRadius,$outerRadius) drawStar($shape,4,"CCCCCC","3F0000",0,0,7,120,270); // $sprite = new SWFSprite(); $sprite->add($shape); $sprite->nextframe(); // $sprite2 = new SWFSprite(); $f1=$sprite2->add($sprite); $f1->scaleto(0.001,0.001); $f1->moveto($w,$w); $sprite2->nextframe(); // $cnt=0; while($cnt++<$dur){ $inc=easeInOutQuad ($cnt, 0, $endscale, $dur); $f1->scaleto($inc,$inc); //$f1->rotateto($inc*360); $sprite2->nextframe(); } // $strAction = "stop();"; $sprite2->add(new SWFAction($strAction)); $sprite2->nextframe(); // return $sprite2; } //}}} //{{{ function masktweenbarsLR function masktweenbarsLR($dur){ $nb=array(2,4,8,16);$numbars=$nb[rand(0,3)]; $dur=($dur/2)-4; $w=256; $h=(256/$numbars)+2; $endscale= 1;$h1=$h-1; $shape = new SWFShape(); $shape->setLeftFill(255,125,0); $shape->drawLine($w,0); $shape->drawLine(0,$h); $shape->drawLine(-$w,0); $shape->drawLine(0,-$h); // $sprite = new SWFSprite(); $sprite->add($shape); $sprite->nextframe(); // $sprite2 = new SWFSprite(); $bar=array(); for($i=0;$i<$numbars;$i++){ $bar[$i]=$sprite2->add($sprite); $bar[$i]->scaleto(0,1); $bar[$i]->moveto(0,$i*$h1); } $sprite2->nextframe(); // $cnt=0; while($cnt++<$dur){ $inc=easeInOutQuad ($cnt, 0, $endscale, $dur); for($i=0;$i<$numbars;$i+=2){ $bar[$i]->scaleto($inc,1); } $sprite2->nextframe(); } // $cnt=0; while($cnt++<$dur){ $inc=easeInOutQuad ($cnt, 0, $endscale, $dur); for($i=1;$i<$numbars;$i+=2){ $bar[$i]->scaleto($inc,1); } $sprite2->nextframe(); } // $strAction = "stop();"; $sprite2->add(new SWFAction($strAction)); $sprite2->nextframe(); // return $sprite2; } //}}} //{{{ function masktweenbarsRL function masktweenbarsRL($dur){ $nb=array(8,16);$numbars=$nb[rand(0,1)]; $dur=($dur/2)-4; $w=256; $h=(256/$numbars)+2; $endscale= 1;$h1=$h-1; $shape = new SWFShape(); $shape->setLeftFill(255,125,0); $shape->drawLine($w,0); $shape->drawLine(0,$h); $shape->drawLine(-$w,0); $shape->drawLine(0,-$h); // $sprite = new SWFSprite(); $sprite->add($shape); $sprite->nextframe(); // $sprite2 = new SWFSprite(); $bar=array(); for($i=0;$i<$numbars;$i++){ $bar[$i]=$sprite2->add($sprite); $bar[$i]->scaleto(0,1); $bar[$i]->rotateto(180); $bar[$i]->moveto($w,$h+($i*$h1)); } $sprite2->nextframe(); // $cnt=0; while($cnt++<$dur){ $inc=easeInOutQuad ($cnt, 0, $endscale, $dur); for($i=0;$i<$numbars;$i+=2){ $bar[$i]->scaleto($inc,1); } $sprite2->nextframe(); } // $cnt=0; while($cnt++<$dur){ $inc=easeInOutQuad ($cnt, 0, $endscale, $dur); for($i=1;$i<$numbars;$i+=2){ $bar[$i]->scaleto($inc,1); } $sprite2->nextframe(); } // $strAction = "stop();"; $sprite2->add(new SWFAction($strAction)); $sprite2->nextframe(); // return $sprite2; } //}}} //{{{ function masktweenbarsLRRL function masktweenbarsLRRL($dur){ $nb=array(8,16);$numbars=$nb[rand(0,1)]; $dur=($dur/2)-8; $w=256; $h=(256/$numbars)+2; $endscale= 1;$h1=$h-1; $shape = new SWFShape(); $shape->setLeftFill(255,125,0); $shape->drawLine($w,0); $shape->drawLine(0,$h); $shape->drawLine(-$w,0); $shape->drawLine(0,-$h); // $sprite = new SWFSprite(); $sprite->add($shape); $sprite->nextframe(); // $sprite2 = new SWFSprite(); $bar=array(); for($i=0;$i<$numbars;$i+=2){ $bar[$i]=$sprite2->add($sprite); $bar[$i]->scaleto(0,1); $bar[$i]->moveto(0,($i*$h1)); } for($i=1;$i<$numbars;$i+=2){ $bar[$i]=$sprite2->add($sprite); $bar[$i]->scaleto(0,1); $bar[$i]->rotateto(180); $bar[$i]->moveto($w,$h+($i*$h1)); } $sprite2->nextframe(); // $cnt=0; while($cnt++<$dur){ $inc=easeInOutQuad ($cnt, 0, $endscale, $dur); for($i=0;$i<$numbars;$i+=2){ $bar[$i]->scaleto($inc,1); } $sprite2->nextframe(); } // $cnt=0; while($cnt++<$dur){ $inc=easeInOutQuad ($cnt, 0, $endscale, $dur); for($i=1;$i<$numbars;$i+=2){ $bar[$i]->scaleto($inc,1); } $sprite2->nextframe(); } // $strAction = "stop();"; $sprite2->add(new SWFAction($strAction)); $sprite2->nextframe(); // return $sprite2; } //}}} //{{{ function masktweenbarsRLLR function masktweenbarsRLLR($dur){ $nb=array(8,16);$numbars=$nb[rand(0,1)]; $dur=($dur/2)-8; $w=256; $h=(256/$numbars)+2; $endscale= 1;$h1=$h-1; $shape = new SWFShape(); $shape->setLeftFill(255,125,0); $shape->drawLine($w,0); $shape->drawLine(0,$h); $shape->drawLine(-$w,0); $shape->drawLine(0,-$h); // $sprite = new SWFSprite(); $sprite->add($shape); $sprite->nextframe(); // $sprite2 = new SWFSprite(); $bar=array(); for($i=0;$i<$numbars;$i+=2){ $bar[$i]=$sprite2->add($sprite); $bar[$i]->scaleto(0,1); $bar[$i]->rotateto(180); $bar[$i]->moveto($w,$h+($i*$h1)); } for($i=1;$i<$numbars;$i+=2){ $bar[$i]=$sprite2->add($sprite); $bar[$i]->scaleto(0,1); $bar[$i]->moveto(0,($i*$h1)); } $sprite2->nextframe(); // $cnt=0; while($cnt++<$dur){ $inc=easeInOutQuad ($cnt, 0, $endscale, $dur); for($i=0;$i<$numbars;$i+=2){ $bar[$i]->scaleto($inc,1); } $sprite2->nextframe(); } // $cnt=0; while($cnt++<$dur){ $inc=easeInOutQuad ($cnt, 0, $endscale, $dur); for($i=1;$i<$numbars;$i+=2){ $bar[$i]->scaleto($inc,1); } $sprite2->nextframe(); } // $strAction = "stop();"; $sprite2->add(new SWFAction($strAction)); $sprite2->nextframe(); // return $sprite2; } //}}} //{{{ function masktweencheck function masktweencheck($dur){ $nb=array(4,8);$numbars=$nb[rand(0,1)]; $dur=($dur/2)-4; $w=256; $h=(256/$numbars)+2; $endscale= 1; $h1=$h-1; //---------------- $cbw=256/$numbars+2;$cbw1=$cbw-1; $rows=$numbars;$cols=$numbars; //---------------- $shape = new SWFShape(); $shape->setLeftFill(255,125,0); $shape->drawLine($cbw,0); $shape->drawLine(0,$cbw); $shape->drawLine(-$cbw,0); $shape->drawLine(0,-$cbw); // $sprite = new SWFSprite(); $sprite->add($shape); $sprite->nextframe(); // $sprite2 = new SWFSprite(); $bar=array(); for($i=0;$i<$rows;$i+=1){ for($j=0;$j<$cols;$j+=1){ $index=($i*100)+$j; $bar[$index]=$sprite2->add($sprite); $bar[$index]->scaleto(0,1); $bar[$index]->moveto($i*$cbw1,$j*$cbw1); } } $sprite2->nextframe(); // $cnt=0; while($cnt++<$dur){ $inc=easeInOutQuad ($cnt, 0, $endscale, $dur); for($i=0;$i<$rows;$i+=2){ for($j=0;$j<$cols;$j+=2){ $index=($i*100)+$j; $index2=(($i+1)*100)+$j+1; $bar[$index]->scaleto($inc,1); $bar[$index2]->scaleto($inc,1); }} $sprite2->nextframe(); } // // $cnt=0; while($cnt++<$dur){ $inc=easeInOutQuad ($cnt, 0, $endscale, $dur); for($i=0;$i<$rows;$i+=2){ for($j=1;$j<$cols;$j+=2){ $index=($i*100)+$j; $index2=(($i+1)*100)+$j-1; $bar[$index]->scaleto($inc,1); $bar[$index2]->scaleto($inc,1); }} $sprite2->nextframe(); } $strAction = "stop();"; $sprite2->add(new SWFAction($strAction)); $sprite2->nextframe(); // return $sprite2; } //}}} //{{{ function masktweencheckR function masktweencheckR($dur){ $nb=array(4,8);$numbars=$nb[rand(0,1)]; $dur=($dur/2)-4; $w=256; $h=(256/$numbars)+2; $endscale= 1; //---------------- $cbw=256/$numbars+2;$cbw1=$cbw-1; $rows=$numbars;$cols=$numbars; //---------------- $shape = new SWFShape(); $shape->setLeftFill(255,125,0); $shape->drawLine($cbw,0); $shape->drawLine(0,$cbw); $shape->drawLine(-$cbw,0); $shape->drawLine(0,-$cbw); // $sprite = new SWFSprite(); $sprite->add($shape); $sprite->nextframe(); // $sprite2 = new SWFSprite(); $bar=array(); for($i=0;$i<$rows;$i+=1){ for($j=0;$j<$cols;$j+=1){ $index=($i*100)+$j; $bar[$index]=$sprite2->add($sprite); $bar[$index]->scaleto(0,1); $bar[$index]->moveto($cbw+($i*$cbw1),$cbw+($j*$cbw1)); $bar[$index]->rotate(180); } } $sprite2->nextframe(); // $cnt=0; while($cnt++<$dur){ $inc=easeInOutQuad ($cnt, 0, $endscale, $dur); for($i=0;$i<$rows;$i+=2){ for($j=0;$j<$cols;$j+=2){ $index=($i*100)+$j; $index2=(($i+1)*100)+$j+1; $bar[$index]->scaleto($inc,1); $bar[$index2]->scaleto($inc,1); }} $sprite2->nextframe(); } // // $cnt=0; while($cnt++<$dur){ $inc=easeInOutQuad ($cnt, 0, $endscale, $dur); for($i=0;$i<$rows;$i+=2){ for($j=1;$j<$cols;$j+=2){ $index=($i*100)+$j; $index2=(($i+1)*100)+$j-1; $bar[$index]->scaleto($inc,1); $bar[$index2]->scaleto($inc,1); }} $sprite2->nextframe(); } $strAction = "stop();"; $sprite2->add(new SWFAction($strAction)); $sprite2->nextframe(); // return $sprite2; } //}}} //{{{ function masktweenbarsH function masktweenbarsH($dur){ $nb=array(8,16);$numbars=$nb[rand(0,1)]; $w=256; $h=(256/$numbars)+2; $endscale= 1;$h1=$h-1; $shape = new SWFShape(); $shape->setLeftFill(255,125,0); $shape->movepento(0,-$h/2); $shape->drawLine($w,0); $shape->drawLine(0,$h); $shape->drawLine(-$w,0); $shape->drawLine(0,-$h); // $sprite = new SWFSprite(); $sprite->add($shape); $sprite->nextframe(); // $sprite2 = new SWFSprite(); $bar=array(); for($i=0;$i<$numbars;$i++){ $bar[$i]=$sprite2->add($sprite); $bar[$i]->scaleto(1,0); $bar[$i]->moveto(0,$h/2+($i*$h)); } $sprite2->nextframe(); // $cnt=0; while($cnt++<$dur){ $inc=easeInOutQuad ($cnt, 0, $endscale, $dur); for($i=0;$i<$numbars;$i++){ $bar[$i]->scaleto(1,$inc); } $sprite2->nextframe(); } // $strAction = "stop();"; $sprite2->add(new SWFAction($strAction)); $sprite2->nextframe(); // return $sprite2; } //}}} //{{{ easing function //// 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; }; function easeInOutQuad ($t, $b, $c, $d) { $t/=$d/2; if ($t < 1) {return $c/2*$t*$t + $b;} return -$c/2 * ((--$t)*($t-2) - 1) + $b; }; // //}}} //{{{ drawStar function //drawStar function converted from actionscript at: //http://www.macromedia.com/devnet/mx/flash/articles/adv_draw_methods.html function drawStar($shape,$lw,$lc,$sc,$x, $y, $points, $innerRadius, $outerRadius) { $numargs=func_num_args(); if($numargs<9){return;} if($numargs==10){$angle=func_get_arg(9);}else{$angle=0;} include "convertcolors.php"; $count = abs($points); if ($count>2) { $step = (M_PI*2)/$points; $halfStep = $step/2; $start = ($angle/180)*M_PI; $shape->movepento($x+(cos($start)*$outerRadius), $y-(sin($start)*$outerRadius)); for ($n=1; $n<=$count; $n++) { $dx = $x+cos($start+($step*$n)-$halfStep)*$innerRadius; $dy = $y-sin($start+($step*$n)-$halfStep)*$innerRadius; $shape->drawlineto($dx, $dy); $dx = $x+cos($start+($step*$n))*$outerRadius; $dy = $y-sin($start+($step*$n))*$outerRadius; $shape->drawlineto($dx, $dy); } } }; //}}} //{{{ drawWedge function //drawWedge function converted from actionscript at: //http://www.macromedia.com/devnet/mx/flash/articles/adv_draw_methods.html function drawWedge ($shape,$lw,$lc,$sc,$x, $y, $startAngle, $arc, $radius) { $numargs=func_num_args(); if($numargs<9){return;} if($numargs==10){$yRadius=func_get_arg(9);}else{$yRadius=$radius;} include "convertcolors.php"; if (abs($arc)>360) { $arc = 360; } $segs = ceil(abs($arc)/45); $segAngle = $arc/$segs; $theta = -($segAngle/180)*M_PI; $angle = -($startAngle/180)*M_PI; if ($segs>0) { $ax = $x+cos($startAngle/180*M_PI)*$radius; $ay = $y+sin(-$startAngle/180*M_PI)*$yRadius; $shape->drawlineto($ax, $ay); for ($i = 0; $i<$segs; $i++) { $angle += $theta; $angleMid = $angle-($theta/2); $bx = $x+cos($angle)*$radius; $by = $y+sin($angle)*$yRadius; $cx = $x+cos($angleMid)*($radius/cos($theta/2)); $cy = $y+sin($angleMid)*($yRadius/cos($theta/2)); $shape->drawcurveto($cx, $cy, $bx, $by); } $shape->drawlineto($x, $y); } }; //}}} //{{{ drawRect function //drawRect function converted from actionscript at: //http://www.macromedia.com/devnet/mx/flash/articles/adv_draw_methods.html function drawRect($shape,$lw,$lc,$sc, $x, $y, $w, $h) { $numargs=func_num_args(); if($numargs<8){return;} if($numargs==9){$cornerRadius=func_get_arg(8);}else{$cornerRadius=0;} include "convertcolors.php"; if ($cornerRadius>0) { if ($cornerRadius>min($w,$h)/2) { $cornerRadius = min($w,$h)/2; } $theta = M_PI/4; $shape->movepento($x+$cornerRadius, $y); $shape->drawlineto($x+$w-$cornerRadius, $y); $angle = -M_PI/2; $cx = $x+$w-$cornerRadius+(cos($angle+($theta/2))*$cornerRadius/cos($theta/2)); $cy = $y+$cornerRadius+(sin($angle+($theta/2))*$cornerRadius/cos($theta/2)); $px = $x+$w-$cornerRadius+(cos($angle+$theta)*$cornerRadius); $py = $y+$cornerRadius+(sin($angle+$theta)*$cornerRadius); $shape->drawcurveto($cx, $cy, $px, $py); $angle += $theta; $cx = $x+$w-$cornerRadius+(cos($angle+($theta/2))*$cornerRadius/cos($theta/2)); $cy = $y+$cornerRadius+(sin($angle+($theta/2))*$cornerRadius/cos($theta/2)); $px = $x+$w-$cornerRadius+(cos($angle+$theta)*$cornerRadius); $py = $y+$cornerRadius+(sin($angle+$theta)*$cornerRadius); $shape->drawcurveto($cx, $cy, $px, $py); $shape->drawlineto($x+$w, $y+$h-$cornerRadius); $angle += $theta; $cx = $x+$w-$cornerRadius+(cos($angle+($theta/2))*$cornerRadius/cos($theta/2)); $cy = $y+$h-$cornerRadius+(sin($angle+($theta/2))*$cornerRadius/cos($theta/2)); $px = $x+$w-$cornerRadius+(cos($angle+$theta)*$cornerRadius); $py = $y+$h-$cornerRadius+(sin($angle+$theta)*$cornerRadius); $shape->drawcurveto($cx, $cy, $px, $py); $angle += $theta; $cx = $x+$w-$cornerRadius+(cos($angle+($theta/2))*$cornerRadius/cos($theta/2)); $cy = $y+$h-$cornerRadius+(sin($angle+($theta/2))*$cornerRadius/cos($theta/2)); $px = $x+$w-$cornerRadius+(cos($angle+$theta)*$cornerRadius); $py = $y+$h-$cornerRadius+(sin($angle+$theta)*$cornerRadius); $shape->drawcurveto($cx, $cy, $px, $py); $shape->drawlineto($x+$cornerRadius, $y+$h); $angle += $theta; $cx = $x+$cornerRadius+(cos($angle+($theta/2))*$cornerRadius/cos($theta/2)); $cy = $y+$h-$cornerRadius+(sin($angle+($theta/2))*$cornerRadius/cos($theta/2)); $px = $x+$cornerRadius+(cos($angle+$theta)*$cornerRadius); $py = $y+$h-$cornerRadius+(sin($angle+$theta)*$cornerRadius); $shape->drawcurveto($cx, $cy, $px, $py); $angle += $theta; $cx = $x+$cornerRadius+(cos($angle+($theta/2))*$cornerRadius/cos($theta/2)); $cy = $y+$h-$cornerRadius+(sin($angle+($theta/2))*$cornerRadius/cos($theta/2)); $px = $x+$cornerRadius+(cos($angle+$theta)*$cornerRadius); $py = $y+$h-$cornerRadius+(sin($angle+$theta)*$cornerRadius); $shape->drawcurveto($cx, $cy, $px, $py); $shape->drawlineto($x, $y+$cornerRadius); $angle += $theta; $cx = $x+$cornerRadius+(cos($angle+($theta/2))*$cornerRadius/cos($theta/2)); $cy = $y+$cornerRadius+(sin($angle+($theta/2))*$cornerRadius/cos($theta/2)); $px = $x+$cornerRadius+(cos($angle+$theta)*$cornerRadius); $py = $y+$cornerRadius+(sin($angle+$theta)*$cornerRadius); $shape->drawcurveto($cx, $cy, $px, $py); $angle += $theta; $cx = $x+$cornerRadius+(cos($angle+($theta/2))*$cornerRadius/cos($theta/2)); $cy = $y+$cornerRadius+(sin($angle+($theta/2))*$cornerRadius/cos($theta/2)); $px = $x+$cornerRadius+(cos($angle+$theta)*$cornerRadius); $py = $y+$cornerRadius+(sin($angle+$theta)*$cornerRadius); $shape->drawcurveto($cx, $cy, $px, $py); } else { $shape->movepento($x, $y); $shape->drawlineto($x+$w, $y); $shape->drawlineto($x+$w, $y+$h); $shape->drawlineto($x, $y+$h); $shape->drawlineto($x, $y); } } //}}} //{{{ lastmask $lastmask = new SWFShape(); // drawRect($shape,$lw,$lc,$sc, $x, $y, $w, $h [, $cornerRadius ] ) drawRect($lastmask,2,"00CC00","FFFF00",0,0,256,256,28); $lm1=$movie->add($lastmask); $lm1->moveto(147,72); $lm1->setMaskLevel(100); for($i=0;$i<20;$i++){ $movie->nextframe(); } //}}} //{{{ make movie $tweenfunctions=array( masktweenwipeLR, masktweenwipeRL, masktweenwipeLR, masktweenwipeRL, masktweenfromedges, masktweenfromcenter, masktweenfromedges, masktweenfromcenter, masktweencircle, masktweencircle, masktweenclock, masktweenclockR, masktweenstar, masktweenbarsLR, masktweenbarsRL, masktweenbarsLRRL, masktweenbarsRLLR, masktweenbarsH, masktweenbarsH, masktweenbarsH, masktweenbarsH, masktweencheckR, masktweencheck, masktweencheckR, ); $mask=array(); for($i=0;$itl=$tl; } for($i=0;$inextframe(); } $mrand=$i%count($mask); $f1 = $movie->add($mask[$mrand]); $f1->moveto(147,72); $f1->setMaskLevel(100); do{$brand=rand(0,count($bitmap)-1);}while($oldbrand==$brand); $oldbrand=$brand; $f2 = $movie->add($bitmap[$brand]); $f2->moveto(147,72); for($j=0;$j<$mask[$mrand]->tl;$j++){ $movie->nextframe();} $movie->remove($f1); if($run++>0){$movie->remove($f4);} $movie->nextframe(); ++$i; for($n=0;$n<15;$n++){ $movie->nextframe(); } $mrand=$i%count($mask); $f3 = $movie->add($mask[$mrand]); $f3->moveto(147,72); $f3->setMaskLevel(100); do{$brand=rand(0,count($bitmap)-1);}while($oldbrand==$brand); $oldbrand=$brand; $f4 = $movie->add($bitmap[$brand]); $f4->moveto(147,72); for($j=0;$j<$mask[$mrand]->tl;$j++){ $movie->nextframe();} $movie->remove($f3); $movie->remove($f2); $movie->nextframe(); } $swfname = basename(__FILE__,".php"); $movie->save("$swfname.swf",9); //}}} ?> // convertcolors.php setline($lw,$lrgb);"); } if($sc!="0"){ $r="0x".$sc[0].$sc[1]; $g="0x".$sc[2].$sc[3]; $b="0x".$sc[4].$sc[5]; $srgb= $r . "," . $g . "," . $b; eval("\$shape->setleftfill($srgb);"); } // if no line or fill then nothing will be drawn so add a default // rainbow gradient fill so that at least something appears if($lw=="0" && $sc=="0"){ // error/default fill $g = new SWFGradient(); $g->addEntry(0.0, 0, 0, 0); $g->addEntry(0.16, 0xff, 0, 0); $g->addEntry(0.32, 0, 0, 0); $g->addEntry(0.48, 0, 0xff, 0); $g->addEntry(0.64, 0, 0, 0); $g->addEntry(0.80, 0, 0, 0xff); $g->addEntry(1.00, 0, 0, 0); $f = $shape->addFill($g,SWFFILL_RADIAL_GRADIENT); $f->scaleTo(0.5,10); $f->skewXTo(1.0); $f->skewYTo(1.0); $shape->setleftfill($f); } ?>