<?
  $s = new SWFShape();
  $f = $s->addFill(0xff, 0, 0);
  $s->setRightFill($f);

  $s->movePenTo(-25,-25);
  $s->drawLineTo(25,-25);
  $s->drawLineTo(25,25);
  $s->drawLineTo(-25,25);
  $s->drawLineTo(-25,-25);

  $p = new SWFSprite();
  $i = $p->add($s);
  $i->setDepth(1);
  $p->nextFrame();

  for($n=0; $n<5; ++$n)
  {
    $i->rotate(-15);
    $p->nextFrame();
  }

  $m = new SWFMovie();
  $m->setBackground(0xff, 0xff, 0xff);
  $m->setDimension(320, 240);

  $i = $m->add($p);
  $i->setDepth(1);
  $i->moveTo(-50, 120);
  $i->setName("box");

  $m->add(new SWFAction("box._x += 3;"));
  $m->nextFrame();
  $m->add(new SWFAction("prevFrame(); play();"));
  $m->nextFrame();

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

click for popup

back to examples

All content Copyright (C) 2000-2001 Opaque Industries except where noted otherwise.