"Fossies" - the Fresh Open Source Software Archive 
Member "gnash-0.8.10/testsuite/misc-haxe.all/AddChild.hx" (19 Jan 2012, 1589 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) haXe source code syntax highlighting (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
1 #include "check.as"
2
3 // Class must be named with the PP prefix, as that's the name the
4 // file passed to haxe will have after the preprocessing step
5 class PP_AddChild {
6 static function main()
7 {
8
9 var thisObject = flash.Lib.current;
10
11 var tf = new flash.text.TextField();
12 var tf2 = flash.Lib.current.addChild(tf);
13 check_equals(tf, tf2);
14 var tf3 = flash.Lib.current.addChild(tf);
15 check_equals(tf, tf3);
16 check_equals(tf2, tf3);
17
18 var tf4 = flash.Lib.current.addChildAt(tf, 0);
19 check_equals(tf4, tf);
20
21 var tf5 = flash.Lib.current.addChildAt(tf, 0);
22 check_equals(tf5, tf);
23 check_equals(tf5, tf2);
24 check_equals(tf5, tf3);
25 check_equals(tf5, tf4);
26
27 var tf6 = flash.Lib.current.addChildAt(tf, 1);
28 check_equals(tf6, tf);
29 check_equals(tf6, tf5);
30 var tf7 = flash.Lib.current.addChildAt(tf, 1);
31 check_equals(tf7, tf);
32 check_equals(tf7, tf6);
33 check_equals(tf7, tf5);
34
35 // Check that this MovieClip has 2 children.
36 xcheck_equals(thisObject.numChildren, 2);
37
38 // Check that the parent of both children is this MovieClip.
39 xcheck_equals(thisObject.getChildAt(1).parent, thisObject);
40 xcheck_equals(thisObject.getChildAt(0).parent, thisObject);
41
42 // TODO: check depths, add a MovieClip child.
43
44 // Check number of tests run (for consistency)
45 check_totals(16);
46
47 // Call this after finishing all tests. It prints out the totals.
48 Dejagnu.done();
49
50 }
51 }