1 // level5.as - Data file for the levels.as test
3 // Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 // Original author: David Rorex - drorex@gmail.com
28 static function main
(mc
)
30 check_equals
(mc
._currentframe
, 1);
32 check
(_level0
.frameno
>= 1);
35 check_equals
(mc
.getDepth
(), -16379);
37 // The ""+ is there to force conversion to a string
38 check_equals
(""+mc
, "_level5");
40 // Mc level is _level0 ? why ?
41 check_equals
(mc
._level
, _level0
);
43 // check that we can acess back to _level0
44 check_equals
(_level0
.testvar
, 1239);
46 // check that we can modify vars on our own level
47 check_equals
(_level5
.testvar
, undefined);
48 _level5
.testvar
= 6789;
49 check_equals
(_level5
.testvar
, 6789);
51 // check that we can modify vars on _level0
52 check_equals
(_level0
.testvar2
, undefined);
53 _level0
.testvar2
= true;
54 check_equals
(_level0
.testvar2
, true);
56 _level5
.onUnload
= function()
58 check
(false); // should not be executed
59 note
("Unloading "+this);
62 mc
.createEmptyMovieClip
("ch", 1);
65 lineStyle
(1, 0x00000);
66 beginFill
(0xFF0000, 80);
73 lineTo
(x
+width
, y
+height
);
79 check_equals
(mc
.ch
._target
, "_level5/ch");
81 // load yet another swf
82 getURL
("level99.swf","_level"+99);
84 getURL
("level87.swf", "_level87");