1 person found this helpful
Chances are the stage is not a defined entity for the class. You might need to add an event listener for ADDED_TO_STAGE wherein the event handler establishes the stage for the class. See if the following tutorial helps solve anything, and if niot, try searching Google using "AS3 ADDED_TO_STAGE"
Thank you for your quick response. I will try now, I wasted 2 days for these problem. If I can solve problem, I will write here
I tried your advice, but I can't solve problem. Can you edit my project? if you help me, I would greatful.
Will itsolve your problem if you pass the stage to the function as an argument. Since the class is not added to the stage, then it probably needs to be provided a reference to it. See the bolded changes/additions to the code below...
var gosterg:Gosterge = new Gosterge();
public class Gosterge extends Sprite
public var cerceve:Sprite = new Sprite ;
public var _stage;
public function Gosterge():void
// constructor code
private function tikla(evt:MouseEvent):void
cerceve.graphics.lineStyle(1, 0x0000FF, 1);
cerceve.x = evt.currentTarget.x - 5;
cerceve.y = evt.currentTarget.y - 5;
public function gostergeleriEkle(stag:Stage,... args):void
_stage = args;
for (var i:uint = 1; i < args.length; i++)
Thank you very much, thank you very much, really thank you very much , I finally understood. It works now . My class couldn't reach the stage. Mr. Ned, you're the best , I'm so grateful