JavaScript Editor Javascript debugger     Website design 


Multiplies the item's color transform ()

SWFDisplayItem {
  void multColor(int red,
                 int green,
                 int blue,
                 int a);


This function is EXPERIMENTAL. The behaviour of this function, the name of this function, and anything else documented about this function may change without notice in a future release of PHP. Use this function at your own risk.

swfdisplayitem->multcolor() multiplies the item's color transform by the given values.

The object may be a swfshape(), a swfbutton(), a swftext() or a swfsprite() object. It must have been added using the swfmovie->add().


These parameters are integers between 0 and 255 or hexadecimals between 0x00 and 0xFF:


Value of red component


Value of green component


Value of blue component


Value of alpha component

Return Values

No value is returned.


This simple example will modify your picture's atmosphere to Halloween (use a landscape or bright picture).

Example 1339. swfdisplayitem->multcolor() example


= new SWFBitmap(file_get_contents("backyard.jpg"));
// note use your own picture :-)
$s = new SWFShape();
$s->drawLine($b->getWidth(), 0);
$s->drawLine(0, $b->getHeight());
$s->drawLine(-$b->getWidth(), 0);
$s->drawLine(0, -$b->getHeight());

$m = new SWFMovie();
$m->setDimension($b->getWidth(), $b->getHeight());

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

for (
$n=0; $n<=20; ++$n) {
$i->multColor(1.0-$n/10, 1.0, 1.0);
$i->addColor(0xff*$n/20, 0, 0);

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