SWFMORPH(3) 1 SWFMORPH(3)The SWFMorph classINTRODUCTION
The methods here are sort of weird. It would make more sense to just have newSWFMorph(shape1, shape2);, but as things are now, shape2
needs to know that it's the second part of a morph. (This, because it starts writing its output as soon as it gets drawing commands- if it
kept its own description of its shapes and wrote on completion this and some other things would be much easier.)
CLASS SYNOPSIS
SWFMorph
SWFMorph
Methods
o
SWFMorph::__construct (void )
o
SWFShape SWFMorph::getShape1 (void )
o
SWFShape SWFMorph::getShape2 (void )
PHP Documentation Group SWFMORPH(3)
Check Out this Related Man Page
SWFSHAPE.ADDFILL(3) 1 SWFSHAPE.ADDFILL(3)SWFShape::addFill - Adds a solid fill to the shape
SYNOPSIS
SWFFill SWFShape::addFill (int $red, int $green, int $blue, [int $alpha = 255])
DESCRIPTION
SWFFill addFill (SWFBitmap $bitmap, [int $flags])
SWFFill addFill (SWFGradient $gradient, [int $flags])
Warning
This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in
a future release of PHP. This function should be used at your own risk.
SWFShape.addFill(3) adds a solid fill to the shape's list of fill styles. SWFShape.addFill(3) accepts three different types of arguments.
$red, $green, $blue is a color (RGB mode).
The $bitmap argument is an SWFBitmap(3) object. The $flags argument can be one of the following values: SWFFILL_CLIPPED_BITMAP, SWF-
FILL_TILED_BITMAP, SWFFILL_LINEAR_GRADIENT or SWFFILL_RADIAL_GRADIENT. Default is SWFFILL_TILED_BITMAP for SWFBitmap and SWFFILL_LIN-
EAR_GRADIENT for SWFGradient.
The $gradient argument is an SWFGradient(3) object. The flags argument can be one of the following values : SWFFILL_RADIAL_GRADIENT or
SWFFILL_LINEAR_GRADIENT. Default is SWFFILL_LINEAR_GRADIENT. I'm sure about this one. Really.
SWFShape.addFill(3) returns an SWFFill(3) object for use with the SWFShape.setLeftFill(3) and SWFShape.setRightFill(3) functions described
below.
EXAMPLES
This simple example will draw a frame on a bitmap. Ah, here's another buglet in the flash player- it doesn't seem to care about the second
shape's bitmap's transformation in a morph. According to spec, the bitmap should stretch along with the shape in this example..
Example #1
SWFShape.addFill(3) example
<?php
$p = new SWFMorph();
$b = new SWFBitmap(file_get_contents("alphafill.jpg"));
// use your own bitmap
$width = $b->getWidth();
$height = $b->getHeight();
$s = $p->getShape1();
$f = $s->addFill($b, SWFFILL_TILED_BITMAP);
$f->moveTo(-$width/2, -$height/4);
$f->scaleTo(1.0, 0.5);
$s->setLeftFill($f);
$s->movePenTo(-$width/2, -$height/4);
$s->drawLine($width, 0);
$s->drawLine(0, $height/2);
$s->drawLine(-$width, 0);
$s->drawLine(0, -$height/2);
$s = $p->getShape2();
$f = $s->addFill($b, SWFFILL_TILED_BITMAP);
// these two have no effect!
$f->moveTo(-$width/4, -$height/2);
$f->scaleTo(0.5, 1.0);
$s->setLeftFill($f);
$s->movePenTo(-$width/4, -$height/2);
$s->drawLine($width/2, 0);
$s->drawLine(0, $height);
$s->drawLine(-$width/2, 0);
$s->drawLine(0, -$height);
$m = new SWFMovie();
$m->setDimension($width, $height);
$i = $m->add($p);
$i->moveTo($width/2, $height/2);
for ($n=0; $n<1.001; $n+=0.03) {
$i->setRatio($n);
$m->nextFrame();
}
header('Content-type: application/x-shockwave-flash');
$m->output();
?>
SEE ALSO SWFShape.setLeftFill(3), SWFShape.setRightFill(3).
PHP Documentation Group SWFSHAPE.ADDFILL(3)