<?
  function rect($r, $g, $b)
  {
    $s = new SWFShape();
    $s->setRightFill($s->addFill($r, $g, $b));
    $s->drawLine(100,0);
    $s->drawLine(0,100);
    $s->drawLine(-100,0);
    $s->drawLine(0,-100);

    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("_root.label = 'SWFBUTTON_MOUSEUP';"),
	        SWFBUTTON_MOUSEUP);

  $b->addAction(new SWFAction("_root.label = 'SWFBUTTON_MOUSEDOWN';"),
		SWFBUTTON_MOUSEDOWN);

  $b->addAction(new SWFAction("_root.label = 'SWFBUTTON_MOUSEOVER';"),
		SWFBUTTON_MOUSEOVER);

  $b->addAction(new SWFAction("_root.label = 'SWFBUTTON_MOUSEOUT';"),
		SWFBUTTON_MOUSEOUT);

  $b->addAction(new SWFAction("_root.label = 'SWFBUTTON_MOUSEUPOUTSIDE';"),
		SWFBUTTON_MOUSEUPOUTSIDE);

  $b->addAction(new SWFAction("_root.label = 'SWFBUTTON_DRAGOVER';"),
		SWFBUTTON_DRAGOVER);

  $b->addAction(new SWFAction("_root.label = 'SWFBUTTON_DRAGOUT';"),
		SWFBUTTON_DRAGOUT);

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

  $t = new SWFTextField();
  $t->setFont(new SWFFont("_serif"));
  $t->addString('NO ACTION');
  $t->setHeight(20);
  $t->setBounds(320,20);
  $t->setName('label');

  $i = $m->add($t);
  $i->moveTo(20, 200);

  $i = $m->add($b);
  $i->moveTo(20, 40);

  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.