Update with current status
[gnash.git] / testsuite / misc-swfmill.all / initaction_in_definesprite.xml
blobde50a41c3fd03da68a08167686e8682cac166e26
1 <?xml version="1.0"?>
2 <swf version="6" compressed="1">
4 <!--
5   |
6   |  This file test that DOINITACTION tag inside a DEFINESPRITE is allowed
7   |  and results in the action to be executed only once and only if the 
8   |  defined sprite is placed.
9   |
10   |  Also, this file tests that of multiple DOINITACTION tags referring to
11   |  the *same* DisplayObject only the first executed gets trough, no matter in
12   |  which timeline the DOINITACTION tag is.
13   |
14   |  Expected output is just an 'END OF TEST' trace.
15   |
16   |  The test could be improved a lot but it ain't easy to do AS coding
17   |  in swfmill....
18   |
19 -->
20   <Header framerate="12" frames="1">
21     <size>
22       <Rectangle left="0" right="12800" top="0" bottom="9600"/>
23     </size>
24     <tags>
26       <DefineSprite objectID="1" frames="1">
27         <tags>
28           <ShowFrame/>
29           <End/>
30         </tags>
31       </DefineSprite>
33       <DefineSprite objectID="3" frames="1">
34         <tags>
35           <DoInitAction sprite="1">
36             <actions>
37               <PushData>
38                 <items>
39                   <StackString value="FAILED: init actions targetting sprite 1 executed again (defined in sprite3)"/>
40                 </items>
41               </PushData>
42               <Trace/>
43               <EndAction/>
44             </actions>
45           </DoInitAction>
46           <ShowFrame/>
47           <End/>
48         </tags>
49       </DefineSprite>
51       <DefineSprite objectID="2" frames="1">
52         <tags>
53           <DoInitAction sprite="1">
54             <actions>
55               <!-- TODO: automate test for these actions to being only executed once -->
56               <PushData>
57                 <items>
58                   <StackString value="END OF TEST"/>
59                   <StackString value="PASSED: executing init actions defined in sprite2 and targetting sprite1"/>
60                 </items>
61               </PushData>
62               <Trace/>
63               <Trace/>
64               <EndAction/>
65             </actions>
66           </DoInitAction>
67           <ShowFrame/>
68           <End/>
69         </tags>
70       </DefineSprite>
72       <!--
73         |  Place the sprite2 containing DOINITACTION block
74         |  referring to object2
75        -->
76       <PlaceObject2 replace="0" depth="1" objectID="2">
77       </PlaceObject2>
79       <!--
80         |  Place the sprite2 containing DOINITACTION block
81         |  referring to object2 *again* at a different depth.
82         | Init actions won't be executed again
83        -->
84       <PlaceObject2 replace="0" depth="2" objectID="2">
85       </PlaceObject2>
87       <!--
88         |  Place the sprite3 containing DOINITACTION block
89         |  referring to object2, for which init actions where
90         |  already executed !
91        -->
92       <PlaceObject2 replace="0" depth="3" objectID="3">
93       </PlaceObject2>
95       <ShowFrame/>
96       <End/>
98     </tags>
99   </Header>
100 </swf>