1 #include <mingpp.h>
2 #include <cstdlib>
3 
main()4 int main()
5 {
6 	try {
7 		SWFMovie *m = new SWFMovie();
8 		SWFShape *s = new SWFShape();
9 		SWFFillStyle *fill = SWFFillStyle::SolidFillStyle(255,255,0,255);
10 		s->setLine(1, 255, 0, 0, 255);
11 		s->setRightFillStyle(fill);
12 		s->drawLine(100,0);
13 		s->drawLine(0,40);
14 		s->drawLineTo(0,0);
15 
16 
17 		SWFButton *b = new SWFButton();
18 		SWFButtonRecord *br1, *br2, *br3;
19 		br1 = b->addCharacter(s, SWFBUTTON_HIT|SWFBUTTON_UP|SWFBUTTON_OVER|SWFBUTTON_DOWN);
20 
21 		br2 = b->addCharacter(s, SWFBUTTON_OVER|SWFBUTTON_DOWN);
22 		br2->rotate(10);
23 		br2->move(20,0);
24 
25 		br3 = b->addCharacter(s, SWFBUTTON_DOWN);
26 		br3->rotate(20);
27 		br3->move(40,0);
28 
29 		SWFDisplayItem *d = m->add(b);
30 		d->moveTo(50, 100);
31 
32 		m->addExport(b, "ButtonExport");
33 		m->writeExports();
34 
35 		m->nextFrame();
36 		m->save("test02.swf");
37 	}
38 	catch(SWFException &e)
39 	{
40 		std::cerr << "SWFException: " << e.what() << std::endl << std::endl;
41 		return EXIT_FAILURE;
42 	}
43 	return 0;
44 }
45