~ubuntu-branches/ubuntu/jaunty/swfdec0.8/jaunty

« back to all changes in this revision

Viewing changes to test/trace/doaction-before-placeobject.c

  • Committer: Package Import Robot
  • Author(s): Didier Roche
  • Date: 2008-10-10 19:15:24 UTC
  • Revision ID: package-import@ubuntu.com-20081010191524-5z85qiky1d4bvgfa
Tags: upstream-0.8.0
ImportĀ upstreamĀ versionĀ 0.8.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* gcc `pkg-config --libs --cflags libming` doaction-before-placeobject.c -o doaction-before-placeobject && ./doaction-before-placeobject
 
2
 */
 
3
 
 
4
#include <ming.h>
 
5
 
 
6
/* The file doaction-after-placeobject.swf was created from 
 
7
 * doaction-before-placeobject.swf by manually swapping the DoAction and
 
8
 * PlaceObject2 tags in the file with a hex editor
 
9
 */
 
10
int
 
11
main (int argc, char **argv)
 
12
{
 
13
  SWFMovie movie;
 
14
  SWFMovieClip clip;
 
15
  SWFDisplayItem item;
 
16
 
 
17
  if (Ming_init ())
 
18
    return 1;
 
19
  Ming_useSWFVersion (7);
 
20
 
 
21
  movie = newSWFMovie();
 
22
  SWFMovie_setRate (movie, 1);
 
23
  SWFMovie_setDimension (movie, 200, 150);
 
24
 
 
25
  clip = newSWFMovieClip ();
 
26
  item = SWFMovie_add (movie, (SWFBlock) clip);
 
27
  SWFDisplayItem_setName (item, "m");
 
28
  SWFDisplayItem_addAction (item, compileSWFActionCode (""
 
29
      "  trace (\"clipEvent (load)\");"
 
30
      "  trace (this);"
 
31
      ""), SWFACTION_ONLOAD);
 
32
  SWFMovie_add (movie, (SWFBlock) compileSWFActionCode (""
 
33
      "trace (\"Frame 0\");"
 
34
      ""));
 
35
 
 
36
  SWFMovie_save (movie, "doaction-before-placeobject.swf");
 
37
  return 0;
 
38
}