<?php
$lineweight = 3;
$linered = 102;
$linegreen = 102;
$lineblue = 255;
$fillred = 204;
$fillgreen = 204;
$fillblue = 255;
$rectlinelen = 200;
$shadowred = 153;
$shadowgreen = 153;
$shadowblue = 153;
$shadowoffset = 3;
$x = 100;
$y = 150;
$m = new SWFMovie();
$m->setDimension(640,480);
$m->setBackground(235,235,235);
$m->setRate(65);
$is = $m->add(shadowrectShape(true));
$i = $m->add(rectShape(true));
$text = "Shadow Play...";
$its = $m->add(textField($text, 15, $shadowred, $shadowgreen, $shadowblue));
$it = $m->add(textField($text, 15, $linered-25, $linegreen, $lineblue));
$is->moveTo($x+$shadowoffset,$y+$shadowoffset);
$i->moveTo($x,$y); $its->moveTo($x+15+1,$y+15+1); $it->moveTo($x+15,$y+15);
for ($n=0; $n < 75; $n++) {
$is->move(2.05, 0.05); $i->move(2,0); $its->move(2, 0.01); $it->move(2,0); $m->nextFrame();
}
$m->add(new SWFAction("stop();"));
$m->nextFrame();
header('Content-type: application/x-shockwave-flash');
$m->output();
?>
<?php
function rectShape($addfill) {
global $lineweight, $linered, $linegreen, $lineblue;
global $fillred, $fillgreen, $fillblue, $rectlinelen;
$s = new SWFShape();
$s->setLine($lineweight, $linered, $linegreen, $lineblue);
if ($addfill) {
$s->setRightFill($s->addFill($fillred, $fillgreen, $fillblue));
}
$s->drawLine($rectlinelen, 0);
$s->drawLine(0, $rectlinelen);
$s->drawLine(-$rectlinelen, 0);
$s->drawLine(0, -$rectlinelen);
return $s;
}
function shadowrectShape($addfill) {
global $lineweight, $rectlinelen;
global $shadowoffset, $shadowred, $shadowgreen, $shadowblue;
$s = new SWFShape();
$s->setLine($lineweight, $shadowred, $shadowgreen, $shadowblue);
if ($addfill) {
$s->setRightFill($s->addFill($shadowred, $shadowgreen, $shadowblue));
}
$s->drawLine($rectlinelen+$shadowoffset, 0);
$s->drawLine(0, $rectlinelen+$shadowoffset);
$s->drawLine(-$rectlinelen-$shadowoffset, 0);
$s->drawLine(0, -$rectlinelen-$shadowoffset);
return $s;
}
function textField($strtext, $intheight, $textred, $textgreen, $textblue) {
$t = new SWFTextField();
$t->setFont(new SWFFont('Default'));
$t->setColor($textred, $textgreen, $textblue);
$t->addString($strtext);
$t->setHeight($intheight);
return $t;
}
?>