Hello everybody
This is my first post in this forum. I am struggling with one issue as below:
In order to make it very simple, I have simplified the code as below:
Test_btn.addEventListener(MouseEvent.CLICK, TestHandler);
function TestHandler(e:MouseEvent):void
{
var mc: myMC = new myMC();
}
/////////// Class definition ///////////
package
{
import flash.display.*;
import flash.events.*;
public class myMC extends MovieClip
{
public function myMC()
{
[COLOR=red]parent.addChild(this); // reports error.[/COLOR]
}
}
}
}
In this case, parent= NULL error shows up.
My requirement is just to load the MC on to the stage. Please help.