Hi to everybody,
How can pass the parent class reference to a son class???
public class Game extends MovieClip{
public var cards : MyCards;
public function Game(){
trace("this: " + this); // this: [global object]
cards = new MyCards( this );
}
}
public class MyCards extends MovieClip{
public var ref : MovieClip;
public function MyCards( ref : MovieClip ){
trace("ref: " + ref); // ERROR
}
}
The Error is:
[COLOR=#ff0000]TypeError: Error #1034: Type Coercion failed: cannot convert global@38fef601 to flash.display.MovieClip.[/COLOR]