1 
2 #include <ming.h>
3 
main(int argc,char * argv[])4 int main(int argc, char *argv[])
5 {
6    SWFMovie movie;
7    SWFShape _i1;
8    SWFFill _fill1_1;
9    SWFButton _i2;
10    char * strAction= ";";
11    SWFMovieClip _i3; // SWFSprite _i3;
12    SWFDisplayItem timeline;
13 
14    Ming_init(argc, argv);
15    Ming_useSWFVersion(4);
16 
17    _i1= newSWFShape();
18    /* SWFShape_setNoLineStyle(_i1);*/
19    _fill1_1= SWFShape_addSolidFill(_i1, 0xFF, 0x00, 0x00, 0xFF);
20    SWFShape_setRightFill(_i1, _fill1_1);
21    SWFShape_movePenTo(_i1, -25.00, -25.00);
22    SWFShape_drawLineTo(_i1, 25.00, -25.00);
23    SWFShape_drawLineTo(_i1, 25.00, 25.00);
24    SWFShape_drawLineTo(_i1, -25.00, 25.00);
25    SWFShape_drawLineTo(_i1, -25.00, -25.00);
26 
27    _i2= newSWFButton();
28    SWFButton_addShape(_i2, (SWFCharacter) _i1,
29       SWFBUTTON_HIT | SWFBUTTON_DOWN | SWFBUTTON_OVER | SWFBUTTON_UP);
30 
31    SWFButton_addAction( _i2, compileSWFActionCode("startDrag('/test', 0);"),
32       SWFBUTTON_MOUSEDOWN);
33 
34    SWFButton_addAction(_i2, compileSWFActionCode("stopDrag();"),
35       SWFBUTTON_MOUSEUP | SWFBUTTON_MOUSEUPOUTSIDE);
36 
37    _i3= newSWFMovieClip();
38    SWFMovieClip_add((SWFMovieClip) _i3, (SWFBlock) _i2);
39    SWFMovieClip_nextFrame((SWFMovieClip) _i3);
40 
41    movie= newSWFMovie();
42    SWFMovie_setDimension(movie, 320, 240);
43 
44    timeline= SWFMovie_add(movie, (SWFBlock) _i3);
45 
46    SWFDisplayItem_setName(timeline, "test");
47    SWFDisplayItem_moveTo(timeline, 160,120);
48    SWFMovie_nextFrame(movie);
49 
50    SWFMovie_save(movie, "drag.swf");
51 
52    return 0;
53 }
54