2 * Copyright (C) 2005, 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
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.
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
20 * Zou Lunkai, zoulunkai@gmail.com
22 * another testcase for ActionGotoFrame
29 #include "ming_utils.h"
31 #define OUTPUT_VERSION 6
32 #define OUTPUT_FILENAME "multi_doactions_and_goto_frame_test.swf"
36 main(int argc
, char** argv
)
39 SWFMovieClip dejagnuclip
;
41 const char *srcdir
=".";
46 fprintf(stderr
, "Usage: %s <mediadir>\n", argv
[0]);
51 mo
= newSWFMovieWithVersion(OUTPUT_VERSION
);
52 SWFMovie_setDimension(mo
, 800, 600);
53 SWFMovie_setRate (mo
, 12.0);
55 dejagnuclip
= get_dejagnu_clip((SWFBlock
)get_default_font(srcdir
), 10, 0, 0, 800, 600);
56 SWFMovie_add(mo
, (SWFBlock
)dejagnuclip
);
57 SWFMovie_nextFrame(mo
); //1st frame
59 /* Current Gnash will not execute actions in the 3rd doAction tag.
60 * Because the m_action_list has been cleared in current goto_frame
61 * function. That why it fails to check x3.
63 add_actions(mo
, " x1 = \"as_in_doAction_tag1\"; "); // doAction Tag1
64 add_actions(mo
, " gotoAndStop(3); \
65 x2 = \"as_in_doAction_tag2\"; "); // doAction Tag2
66 add_actions(mo
, " x3 = \"as_in_doAction_tag3\"; "); // doAction Tag3
67 SWFMovie_nextFrame(mo
); //2nd frame
71 check_equals(mo
, "x1", "'as_in_doAction_tag1'");
72 check_equals(mo
, "x2", "'as_in_doAction_tag2'");
73 check_equals(mo
, "x3", "'as_in_doAction_tag3'");
74 add_actions(mo
, " _root.totals(); stop(); ");
75 SWFMovie_nextFrame(mo
); //3rd frame
78 puts("Saving " OUTPUT_FILENAME
);
79 SWFMovie_save(mo
, OUTPUT_FILENAME
);