"Fossies" - the Fresh Open Source Software Archive 
Member "gnash-0.8.10/testsuite/misc-ming.all/action_order/action_execution_order_test7.c" (19 Jan 2012, 2444 Bytes) of package /linux/www/old/gnash-0.8.10.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 /*
2 * Copyright (C) 2005, 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 *
17 */
18
19
20 #include <stdlib.h>
21 #include <stdio.h>
22 #include <ming.h>
23
24 #include "ming_utils.h"
25
26 #define OUTPUT_VERSION 6
27 #define OUTPUT_FILENAME "action_execution_order_test7.swf"
28
29
30 int
31 main(int argc, char** argv)
32 {
33 SWFMovie mo;
34 SWFMovieClip mc, dejagnuclip;
35
36 const char *srcdir=".";
37 if ( argc>1 )
38 srcdir=argv[1];
39 else
40 {
41 fprintf(stderr, "Usage: %s <mediadir>\n", argv[0]);
42 return 1;
43 }
44
45 Ming_init();
46 mo = newSWFMovieWithVersion(OUTPUT_VERSION);
47 SWFMovie_setDimension(mo, 800, 600);
48 SWFMovie_setRate (mo, 12.0);
49
50 dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0, 800, 600);
51 SWFMovie_add(mo, (SWFBlock)dejagnuclip);
52 SWFMovie_nextFrame(mo); /* 1st frame */
53
54 mc = newSWFMovieClip();
55 add_clip_actions(mc, "_root.x = 1;"
56 "_root.check_equals(_root.x, 1);");
57 SWFMovieClip_nextFrame(mc);
58
59
60 add_actions(mo, " gotoAndPlay(4); ");
61 SWFMovie_nextFrame(mo); /* 2nd frame */
62
63 SWFMovie_nextFrame(mo); /* 3rd frame */
64
65
66 /* add mc to _root and name it as "mc" */
67 SWFDisplayItem it;
68 it = SWFMovie_add(mo, (SWFBlock)mc);
69 SWFDisplayItem_setDepth(it, 3);
70 SWFDisplayItem_setName(it, "mc");
71 add_actions(mo, " _root.x = 2; "
72 " _root.check_equals(_root.x, 2); ");
73 SWFMovie_nextFrame(mo); /* 4th frame */
74
75 SWFDisplayItem_remove(it);
76 check_equals(mo, "_root.x", "1");
77 check_equals(mo, "typeof(mc)", "'undefined'");
78 add_actions(mo, " _root.totals(); stop(); ");
79 SWFMovie_nextFrame(mo); /* 5th frame */
80
81 //Output movie
82 puts("Saving " OUTPUT_FILENAME );
83 SWFMovie_save(mo, OUTPUT_FILENAME);
84
85 return 0;
86 }
87
88
89