SWFDisplayItem->multColor

(no version information, might be only in CVS)

SWFDisplayItem->multColor -- Multiplies the item's color transform

Description

void swfdisplayitem->multcolor ( [int red [, int green [, int blue [, int a]]]])

Warning

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().

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

Example 1. swfdisplayitem->multcolor() example

<?php

  $b
= new SWFBitmap("backyard.jpg");
  
// note use your own picture :-)
  
$s = new SWFShape();
  
$s->setRightFill($s->addFill($b));
  
$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);
    
$m->nextFrame();
  }

  
header('Content-type: application/x-shockwave-flash');
  
$m->output();
?>

ont>);
    
$s->drawLine(-600, 0);
    
$s->drawLine(0, -600);

    return
$s;
  }

  
$b = new SWFButton();
  
$b->addShape(rect(0xff, 0, 0), SWFBUTTON_UP | SWFBUTTON_HIT);
  
$b->addShape(rect(0, 0xff, 0), SWFBUTTON_OVER);
  
$b->addShape(rect(0, 0, 0xff), SWFBUTTON_DOWN);

  
$b->addAction(new SWFAction("setTarget('/label'); gotoFrame(1);"),
            
SWFBUTTON_MOUSEUP);

  
$b->addAction(new SWFAction("setTarget('/label'); gotoFrame(2);"),
        
SWFBUTTON_MOUSEDOWN);

  
$b->addAction(new SWFAction("setTarget('/label'); gotoFrame(3);"),
        
SWFBUTTON_MOUSEOVER);

  
$b->addAction(new SWFAction("setTarget('/label'); gotoFrame(4);"),
        
SWFBUTTON_MOUSEOUT);

  
$b->addAction(new SWFAction("setTarget('/label'); gotoFrame(5);"),
        
SWFBUTTON_MOUSEUPOUTSIDE);

  
$b->addAction(new SWFAction("setTarget('/label'); gotoFrame(6);"),
        
SWFBUTTON_DRAGOVER);

  
$b->addAction(new SWFAction("setTarget('/label'); gotoFrame(7);"),
        
SWFBUTTON_DRAGOUT);

  
$m = new SWFMovie();
  
$m->setDimension(4000, 3000);

  
$i = $m->add($p);
  
$i->setName("label");
  
$i->moveTo(400, 1900);

  
$i = $m->add($b);
  
$i->moveTo(400, 900);

  
header('Content-type: application/x-shockwave-flash');
  
$m->output();
?>