
#include <mingpp.h>

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

  SWFShape *s = new SWFShape();
  SWFFill *f = s->addSolidFill(0xff, 0, 0);
  s->setRightFill(f);

  s->movePenTo(-500,-500);
  s->drawLineTo(500,-500);
  s->drawLineTo(500,500);
  s->drawLineTo(-500,500);
  s->drawLineTo(-500,-500);

  SWFSprite *p = new SWFSprite();
  SWFDisplayItem *i;

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

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

  SWFMovie *m = new SWFMovie();
  m->setBackground(0xff, 0xff, 0xff);
  m->setDimension(6000,4000);

  i = m->add(p);
  i->setDepth(1);
  i->moveTo(-500,2000);
  i->setName("box");

  m->add(new SWFAction("x=-100;"));
  m->nextFrame();
  m->add(new SWFAction("x+=3; /box.x=x;"));
  m->nextFrame();
  m->add(new SWFAction("gotoFrame(1); play();"));
  m->nextFrame();

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

  exit(0);
}
