I got the following file Tiles.as
package{
import flash.display.*;
public class Tiles extends MovieClip{
public var map:MovieClip = new MovieClip();
private var stageSet:Stage;
public function Tiles(stageRef:Stage):void{
stageSet = stageRef;
}
/* i draw on map MC with drawing API and i want it to be shown on Stage (main frame), but i cant access it*/
public function createMap():void{
map.graphics.lineStyle(1,0x990000);
map.graphics.moveTo(0,0);
map.graphics.lineTo(100,100);
stageSet.addChild(map);
}
}
}
and following code in Tiles.fla
var Tile:Tiles = new Tiles(Stage);
Tile.createMap();
and i get error like this :1067: Implicit coercion of a value of type Class to an unrelated type flash.display:Stage.