例 1. swfgradient() の例
<?php
$m = new SWFMovie(); $m->setDimension(320, 240);
$s = new SWFShape();
// 最初の gradient - 黒から白 $g = new SWFGradient(); $g->addEntry(0.0, 0, 0, 0); $g->addEntry(1.0, 0xff, 0xff, 0xff);
$f = $s->addFill($g, SWFFILL_LINEAR_GRADIENT); $f->scaleTo(0.01); $f->moveTo(160, 120); $s->setRightFill($f); $s->drawLine(320, 0); $s->drawLine(0, 240); $s->drawLine(-320, 0); $s->drawLine(0, -240);
$m->add($s);
$s = new SWFShape();
// 2 番目の gradient - 赤から透明への放射状の gradient $g = new SWFGradient(); $g->addEntry(0.0, 0xff, 0, 0, 0xff); $g->addEntry(1.0, 0xff, 0, 0, 0);
$f = $s->addFill($g, SWFFILL_RADIAL_GRADIENT); $f->scaleTo(0.005); $f->moveTo(160, 120); $s->setRightFill($f); $s->drawLine(320, 0); $s->drawLine(0, 240); $s->drawLine(-320, 0); $s->drawLine(0, -240);
$m->add($s);
header('Content-type: application/x-shockwave-flash'); $m->output(); ?>
|
|