Example #1
0
#!/usr/bin/php -c.

<?php 
$srcdir = $argv[1];
$m = new SWFMovie(9);
$m->setBackground(0xcc, 0xcc, 0xcc);
$s = new SWFShape();
$img = new SWFBitmap($srcdir . "/../Media/image01.dbl");
$fill = $s->addFill($img, SWFFILL_TILED_BITMAP);
$s->setRightFill($fill);
$w = $img->getWidth();
$h = $img->getHeight();
$s->drawLine($w, 0);
$s->drawLine(0, $h);
$s->drawLine(-$w, 0);
$s->drawLine(0, -$h);
$cm = array();
for ($i = 0; $i < 20; $i++) {
    $cm[$i] = 0.1;
}
$cmf = new SWFFilterMatrix(5, 4, $cm);
$filter = new SWFFilter(SWFFILTER_TYPE_COLORMATRIX, $cmf);
$bu = new SWFButton();
$bu->addCharacter($s, SWFBUTTON_UP | SWFBUTTON_HIT | SWFBUTTON_OVER | SWFBUTTON_DOWN);
$item = $m->add($bu);
$item->addFilter($filter);
$m->save("test05.swf");
Example #2
0
#!/usr/bin/php -c.
<?php 
$m = new SWFMovie();
$s = new SWFShape();
$s->setLine(1, 255, 0, 0, 255);
$s->setRightFill(255, 255, 0, 255);
$s->drawLine(100, 0);
$s->drawLine(0, 40);
$s->drawLineTo(0, 0);
$b = new SWFButton();
$br1 = $b->addCharacter($s, SWFBUTTON_HIT | SWFBUTTON_UP | SWFBUTTON_OVER | SWFBUTTON_DOWN);
$br2 = $b->addCharacter($s, SWFBUTTON_OVER | SWFBUTTON_DOWN);
$br2->rotate(10);
$br2->move(20, 0);
$br3 = $b->addCharacter($s, SWFBUTTON_DOWN);
$br3->rotate(20);
$br3->move(40, 0);
$d = $m->add($b);
$d->moveTo(50, 100);
$m->addExport($b, "ButtonExport");
$m->writeExports();
$m->nextFrame;
$m->save("test02.swf");
?>