Update with current status
[gnash.git] / testsuite / as3compile.all / MovieClip.as
blob719191e3da243578d8108664d26f160edaab753b
1 //
2 // Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software
3 // Foundation, Inc
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #include "check.as"
21 package hello {
23 import flash.display.MovieClip;
25 public class Main extends MovieClip {
27 DEJAGNU_OBJ;
29 public function Main() {
31 xcheck_equals(MovieClip, "[class MovieClip]");
32 xcheck_equals(MovieClip.prototype, "[object Object]");
33 xcheck_equals(MovieClip.constructor, "[class Class]");
34 xcheck(!MovieClip.hasOwnProperty("constructor"));
36 // Check that this object is a MovieClip and has MovieClip
37 // functions (no need to check them all).
38 xcheck(this instanceof MovieClip);
39 xcheck_equals(typeof(this.nextFrame), "function");
40 xcheck_equals(typeof(this.play), "function");
42 xcheck(MovieClip.prototype.hasOwnProperty("constructor"));
44 check(!MovieClip.hasOwnProperty("nextFrame"));
45 check(!MovieClip.hasOwnProperty("prevFrame"));
46 check(!MovieClip.hasOwnProperty("gotoAndStop"));
47 check(!MovieClip.hasOwnProperty("nextScene"));
48 check(!MovieClip.hasOwnProperty("prevScene"));
49 check(!MovieClip.hasOwnProperty("play"));
50 check(!MovieClip.hasOwnProperty("stop"));
51 check(!MovieClip.hasOwnProperty("addFrameScript"));
52 check(!MovieClip.hasOwnProperty("framesLoaded"));
53 check(!MovieClip.hasOwnProperty("totalFrames"));
54 check(!MovieClip.hasOwnProperty("currentFrame"));
56 // The prototype seems really to be just an object. Just
57 // test the MovieClip properties until there's a reason
58 // to check others.
60 check(!MovieClip.prototype.hasOwnProperty("nextFrame"));
61 check(!MovieClip.prototype.hasOwnProperty("prevFrame"));
62 check(!MovieClip.prototype.hasOwnProperty("gotoAndStop"));
63 check(!MovieClip.prototype.hasOwnProperty("nextScene"));
64 check(!MovieClip.prototype.hasOwnProperty("prevScene"));
65 check(!MovieClip.prototype.hasOwnProperty("play"));
66 check(!MovieClip.prototype.hasOwnProperty("stop"));
67 check(!MovieClip.prototype.hasOwnProperty("addFrameScript"));
68 check(!MovieClip.prototype.hasOwnProperty("framesLoaded"));
69 check(!MovieClip.prototype.hasOwnProperty("totalFrames"));
70 check(!MovieClip.prototype.hasOwnProperty("currentFrame"));
72 var m = new MovieClip();
73 xcheck_equals(m.constructor, "[class MovieClip]");
74 xcheck(!m.hasOwnProperty("constructor"));
76 // MovieClip properties
77 xcheck(m.hasOwnProperty("nextFrame"));
78 xcheck(m.hasOwnProperty("prevFrame"));
79 xcheck(m.hasOwnProperty("gotoAndStop"));
80 xcheck(m.hasOwnProperty("nextScene"));
81 xcheck(m.hasOwnProperty("prevScene"));
82 xcheck(m.hasOwnProperty("play"));
83 xcheck(m.hasOwnProperty("stop"));
84 xcheck(m.hasOwnProperty("addFrameScript"));
85 xcheck(m.hasOwnProperty("framesLoaded"));
86 xcheck(m.hasOwnProperty("totalFrames"));
87 xcheck(m.hasOwnProperty("currentFrame"));
89 // Sprite properties
90 xcheck(m.hasOwnProperty("graphics"));
91 xcheck(m.hasOwnProperty("buttonMode"));
92 xcheck(m.hasOwnProperty("dropTarget"));
93 xcheck(m.hasOwnProperty("soundTransform"));
94 xcheck(m.hasOwnProperty("useHandCursor"));
95 xcheck(m.hasOwnProperty("stopDrag"));
96 xcheck(m.hasOwnProperty("startDrag"));
98 // DisplayObjectContainer properties
99 xcheck(m.hasOwnProperty("addChild"));
100 xcheck(m.hasOwnProperty("removeChild"));
102 // DisplayObject properties (?)
103 xcheck(m.hasOwnProperty("transform"));
104 xcheck(m.hasOwnProperty("scale9Grid"));
105 xcheck(m.hasOwnProperty("localToGlobal"));
106 xcheck(m.hasOwnProperty("globalToLocal"));
107 xcheck(m.hasOwnProperty("getBounds"));
108 xcheck(m.hasOwnProperty("scrollRect"));
109 xcheck(m.hasOwnProperty("tabIndex"));
110 xcheck(m.hasOwnProperty("opaqueBackground"));
111 xcheck(m.hasOwnProperty("filters"));
112 xcheck(m.hasOwnProperty("cacheAsBitmap"));
113 xcheck(m.hasOwnProperty("getRect"));
115 // AS2-only properties
116 check(!m.hasOwnProperty("loadVariables"));
117 check(!m.hasOwnProperty("getSWFVersion"));
118 check(!m.hasOwnProperty("url"));
119 check(!m.hasOwnProperty("meth"));
120 check(!m.hasOwnProperty("forceSmoothing"));
121 check(!m.hasOwnProperty("lineGradientStyle"));
122 check(!m.hasOwnProperty("getTextSnapshot"));
123 check(!m.hasOwnProperty("getNextHighestDepth"));
124 check(!m.hasOwnProperty("getInstanceAtDepth"));
125 check(!m.hasOwnProperty("swapDepths"));
126 check(!m.hasOwnProperty("hitTest"));
127 check(!m.hasOwnProperty("setMask"));
128 check(!m.hasOwnProperty("setMask"));
129 check(!m.hasOwnProperty("getDepth"));
130 check(!m.hasOwnProperty("getBytesTotal"));
131 check(!m.hasOwnProperty("getBytesLoaded"));
132 check(!m.hasOwnProperty("duplicateMovieClip"));
133 check(!m.hasOwnProperty("beginGradientFill"));
134 check(!m.hasOwnProperty("moveTo"));
135 check(!m.hasOwnProperty("lineTo"));
136 check(!m.hasOwnProperty("lineStyle"));
137 check(!m.hasOwnProperty("clear"));
138 check(!m.hasOwnProperty("endFill"));
139 check(!m.hasOwnProperty("beginFill"));
140 check(!m.hasOwnProperty("curveTo"));
141 check(!m.hasOwnProperty("createTextField"));
142 check(!m.hasOwnProperty("removeMovieClip"));
143 check(!m.hasOwnProperty("createEmptyMovieClip"));
144 check(!m.hasOwnProperty("beginBitmapFill"));
145 check(!m.hasOwnProperty("attachBitmap"));
146 check(!m.hasOwnProperty("getURL"));
147 check(!m.hasOwnProperty("loadMovie"));
148 check(!m.hasOwnProperty("unloadMovie"));
149 check(!m.hasOwnProperty("attachMovie"));
150 check(!m.hasOwnProperty("attachVideo"));
151 check(!m.hasOwnProperty("attachAudio"));
153 // Check type of MovieClip properties. Inherited properties should
154 // be dealt with elsewhere.
155 check_equals(typeof(m.nextFrame), "function");
156 check_equals(typeof(m.prevFrame), "function");
157 check_equals(typeof(m.gotoAndStop), "function");
158 check_equals(typeof(m.nextScene), "function");
159 check_equals(typeof(m.prevScene), "function");
160 check_equals(typeof(m.play), "function");
161 check_equals(typeof(m.stop), "function");
162 check_equals(typeof(m.addFrameScript), "function");
163 xcheck_equals(typeof(m.framesLoaded), "number");
164 xcheck_equals(typeof(m.totalFrames), "number");
165 xcheck_equals(typeof(m.currentFrame), "number");
167 totals(110);
169 done();