1 /* gcc `pkg-config --libs --cflags libming` registerclass-previous.c -o registerclass-previous && ./registerclass-previous
7 main (int argc
, char **argv
)
15 Ming_useSWFVersion (7);
17 movie
= newSWFMovie();
18 SWFMovie_setRate (movie
, 1);
19 SWFMovie_setDimension (movie
, 200, 150);
21 clip
= newSWFMovieClip ();
22 SWFMovie_addExport (movie
, (SWFBlock
) clip
, "export");
23 item
= SWFMovie_add (movie
, (SWFBlock
) clip
);
24 SWFDisplayItem_setName (item
, "m");
25 SWFMovie_add (movie
, (SWFBlock
) compileSWFActionCode (""
26 "trace (\"Check that registerClass does not influence previously created instances\");"
28 " trace (this + \": Constructor\");"
30 "fun.prototype = new Object ();"
31 "fun.prototype.foo = function () {"
32 " trace (\"foo called on \" + this);"
34 "Object.registerClass (\"export\", fun);"
37 SWFMovie_nextFrame (movie
);
39 item
= SWFMovie_add (movie
, (SWFBlock
) clip
);
40 SWFDisplayItem_setName (item
, "m2");
41 SWFMovie_add (movie
, (SWFBlock
) compileSWFActionCode (""
47 SWFMovie_save (movie
, "registerclass-previous.swf");