Quote:
Originally Posted by bluemagica
try
var a = new A();
trace(a.gravity);
|
Crap, that gives me run time errors:
Error: Error #2136: The SWF file file:///F|/Multimedia%20Major%20Project/Game/Untitlegrd%2D1.swf contains invalid data.
at CollisonDetection$iinit()
at flash.display::Sprite/flash.display:Sprite::constructChildren()
at flash.display::Sprite$iinit()
at flash.display::MovieClip$iinit()
at GameEngine$iinit()
I removed the fact that this class (B) belongs to a movieclip in the libary and removed the extends in class B and added this to my class A (still talking in the context of your example):
Code:
var b = new B();
b.init();
I than tried the following combinations each separated by a comment:
Code:
var a = new GameEngine();
a.trace(gravity);
//
var a = new GameEngine();
trace(a.gravity);
//
trace(GameEngine.gravity);
//
GameEngine.trace(gravity);
//
trace(gravity);
All gave errors. Honestly, its as if the import statement isn't doing anything. It give me an error if I type in a fictional class, but if I add class A to it, it acknowledges the fact that its there but doesn't do anything.