Skip to content

Commit bd57f81

Browse files
nivknerLord-McSweeney
authored andcommitted
core: Test cleanup + goto under SWF9
1 parent e894a89 commit bd57f81

File tree

37 files changed

+1005
-0
lines changed

37 files changed

+1005
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Main Constructor
2+
Main addFrameScript
3+
Main frame1
4+
Main frame2
5+
MyContainer Constructor
6+
MyChild Constructor
7+
MyChild addFrameScript
8+
MyChild Constructor
9+
MyChild addFrameScript
10+
MyContainer addFrameScript
11+
MyChild frame1
12+
MyChild frame1
13+
MyContainer frame1
14+
MyChild frame2
15+
MyChild frame2
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package
2+
{
3+
import flash.display.MovieClip;
4+
5+
public class Main extends MovieClip
6+
{
7+
public var child:*;
8+
9+
public var mainSideChild:*;
10+
11+
public var secretChild:*;
12+
13+
public function Main()
14+
{
15+
trace("Main Constructor");
16+
super();
17+
trace("Main addFrameScript");
18+
}
19+
}
20+
}
21+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package
2+
{
3+
import flash.display.MovieClip;
4+
5+
public class MyChild extends MovieClip
6+
{
7+
public var myField:uint;
8+
9+
public var myFieldWithInit:Object = "Default value";
10+
11+
public function MyChild()
12+
{
13+
trace("MyChild Constructor");
14+
super();
15+
trace("MyChild addFrameScript");
16+
}
17+
}
18+
}
19+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package
2+
{
3+
import flash.display.MovieClip;
4+
5+
public class MyContainer extends MovieClip
6+
{
7+
public var otherChild:*;
8+
9+
public var myOtherChild:*;
10+
11+
public var dumbButton1:*;
12+
13+
public var dumbButton2:*;
14+
15+
public var dumbChild:*;
16+
17+
public function MyContainer()
18+
{
19+
trace("MyContainer Constructor");
20+
super();
21+
trace("MyContainer addFrameScript");
22+
}
23+
}
24+
}
25+
7 KB
Binary file not shown.
6.76 KB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
num_frames = 20
7.46 KB
Binary file not shown.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Main constructor
2+
Container constructor
3+
Child constructor
4+
GrandChild constructor
5+
LeafChild constructor
6+
Main addFrameScript
7+
Child addFrameScript
8+
Main frame1
9+
GrandChild addFrameScript
10+
Container addFrameScript
11+
LeafChild addFrameScript
12+
Child frame1
13+
GrandChild frame1
14+
Container frame1
15+
LeafChild frame1
16+
Main frame2
17+
Container frame2
18+
Child frame2
19+
GrandChild frame2
20+
LeafChild frame2
21+
Container frame1
22+
Child frame1
23+
GrandChild frame1
24+
LeafChild frame1
25+
Main frame1
26+
Container frame2
27+
Child frame2
28+
GrandChild frame2
29+
LeafChild frame2
30+
Main frame2
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
package
2+
{
3+
import flash.display.MovieClip;
4+
5+
public class Main extends MovieClip
6+
{
7+
public var child:*;
8+
9+
public var repeats:uint = 0;
10+
11+
public var descendant_names:Array = ["Container","Child","GrandChild","LeafChild"];
12+
13+
public var descendant_order:Array = [2,0,1,3];
14+
15+
public function Main()
16+
{
17+
trace("Main constructor");
18+
super();
19+
this.addScripts();
20+
var descendants:* = collectDescendants();
21+
for(i in this.descendant_order)
22+
{
23+
if(this.descendant_order[i] == 0)
24+
{
25+
descendants[i].addScripts();
26+
}
27+
}
28+
}
29+
30+
public function collectDescendants() : Array
31+
{
32+
return [this.child].concat(this.child.collectDescendants());
33+
}
34+
35+
public function addScripts() : *
36+
{
37+
trace("Main addFrameScript");
38+
addFrameScript(0,this.frame1,1,this.frame2);
39+
}
40+
41+
internal function frame1() : *
42+
{
43+
trace("Main frame1");
44+
if(this.repeats > 0)
45+
{
46+
return;
47+
}
48+
var descendants:* = collectDescendants();
49+
for(i in this.descendant_order)
50+
{
51+
for(j in this.descendant_order)
52+
{
53+
if(this.descendant_order[j] == i + 1)
54+
{
55+
descendants[j].addScripts();
56+
}
57+
}
58+
}
59+
gotoAndPlay(1);
60+
}
61+
62+
internal function frame2() : *
63+
{
64+
trace("Main frame2");
65+
if(this.repeats > 0)
66+
{
67+
stop();
68+
}
69+
else
70+
{
71+
this.repeats += 1;
72+
}
73+
}
74+
}
75+
}
76+

0 commit comments

Comments
 (0)