
#include <mingpp.h>

int main()
{
  Ming_init();
  Ming_setScale(1.0);

  SWFShape *s = new SWFShape();
  s->setRightFill(s->addSolidFill(0xff, 0, 0));
  s->drawLine(1000,0);
  s->drawLine(0,1000);
  s->drawLine(-1000,0);
  s->drawLine(0,-1000);

  SWFButton *b = new SWFButton();
  b->addShape(s, SWFBUTTON_HIT | SWFBUTTON_UP | SWFBUTTON_DOWN | SWFBUTTON_OVER);

  b->addAction(new SWFAction("startDrag('/test', 0);"), // '0' means don't lock to mouse
	       SWFBUTTON_MOUSEDOWN);

  b->addAction(new SWFAction("stopDrag();"),
	       SWFBUTTON_MOUSEUP);

  SWFSprite *p = new SWFSprite();
  p->add(b);
  p->nextFrame();

  SWFMovie *m = new SWFMovie();
  SWFDisplayItem *i = m->add(p);
  i->setName("test");
  i->moveTo(1000,1000);

  m->save("test.swf");

  exit(0);
}
