PHP 5.4.31 Released


(PHP 4 >= 4.0.5)

SWFShape::setLineSets the shape's line style


void SWFShape::setLine ( SWFShape $shape )
void setLine ( int $width , int $red , int $green , int $blue [, int $a ] )

Diese Funktion ist EXPERIMENTELL. Das Verhalten, der Funktionsname und alles Andere, was hier dokumentiert ist, kann sich in zukünftigen PHP-Versionen ohne Ankündigung ändern. Seien Sie gewarnt und verwenden Sie diese Funktion auf eigenes Risiko.

swfshape::setline() sets the shape's line style. width is the line's width. If width is 0, the line's style is removed (then, all other arguments are ignored). If width > 0, then line's color is set to red, green, blue. Last parameter a is optional.

You must declare all line styles before you use them (see example).


Es wird kein Wert zurückgegeben.


This simple example will draw a big "!#%*@", in funny colors and gracious style.

Beispiel #1 swfshape::setline() example

= new SWFShape();
$f1 $s->addFill(0xff00);
$f2 $s->addFill(0xff0x7f0);
$f3 $s->addFill(0xff0xff0);
$f4 $s->addFill(00xff0);
$f5 $s->addFill(000xff);

// bug: have to declare all line styles before you use them

$f = new SWFFont('Techno.fdb');

$s->movePen($f->getWidth('!'), 0);

$s->movePen($f->getWidth('#'), 0);

$s->movePen($f->getWidth('%'), 0);

$s->movePen($f->getWidth('*'), 0);


$m = new SWFMovie();
$i $m->add($s);

header('Content-type: application/x-shockwave-flash');


Es wird kein Wert zurückgegeben.

add a note add a note

User Contributed Notes 1 note

2 years ago
Just wanted to point out that a $width value of 0 does _not_ prevent the line from being drawn.  It causes a non-scaling, single pixel line to be drawn.  This is analogous to the way this is handled in ActionScript (see

If you do not want a line to be drawn at all, use NAN for $width instead of zero.
To Top