swfsprite->add

(no version information, might be only in CVS)

swfsprite->add -- Adds an object to a sprite

Description

void swfsprite->add ( resource object)

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.

swfsprite->add() adds a swfshape(), a swfbutton(), a swftext(), a swfaction() or a swfsprite() object.

For displayable types (swfshape(), swfbutton(), swftext(), swfaction() or swfsprite()), this returns a handle to the object in a display list.

>);
  $f2 = $s->addFill(0xff, 0x7f, 0);
  
$f3 = $s->addFill(0xff, 0xff, 0);
  
$f4 = $s->addFill(0, 0xff, 0);
  
$f5 = $s->addFill(0, 0, 0xff);

  
// bug: have to declare all line styles before you use them
  
$s->setLine(40, 0x7f, 0, 0);
  
$s->setLine(40, 0x7f, 0x3f, 0);
  
$s->setLine(40, 0x7f, 0x7f, 0);
  
$s->setLine(40, 0, 0x7f, 0);
  
$s->setLine(40, 0, 0, 0x7f);

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

  
$s->setRightFill($f1);
  
$s->setLine(40, 0x7f, 0, 0);
  
$s->drawGlyph($f, '!');
  
$s->movePen($f->getWidth('!'), 0);

  
$s->setRightFill($f2);
  
$s->setLine(40, 0x7f, 0x3f, 0);
  
$s->drawGlyph($f, '#');
  
$s->movePen($f->getWidth('#'), 0);

  
$s->setRightFill($f3);
  
$s->setLine(40, 0x7f, 0x7f, 0);
  
$s->drawGlyph($f, '%');
  
$s->movePen($f->getWidth('%'), 0);

  
$s->setRightFill($f4);
  
$s->setLine(40, 0, 0x7f, 0);
  
$s->drawGlyph($f, '*');
  
$s->movePen($f->getWidth('*'), 0);

  
$s->setRightFill($f5);
  
$s->setLine(40, 0, 0, 0x7f);
  
$s->drawGlyph($f, '@');

  
$m = new SWFMovie();
  
$m->setDimension(3000,2000);
  
$m->setRate(12.0);
  
$i = $m->add($s);
  
$i->moveTo(1500-$f->getWidth("!#%*@")/2, 1000+$f->getAscent()/2);

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