[LEFT]If I want to have a mouseEvent and add an image to a sprite I need to add the image in the class and not after ?
See where I have used addChild?
myintro=new ClassIntro(IntroCanvas,0,0);[/LEFT]
myintro.addEventListener (“introClicked”,intro_Handler);
***IntroCanvas.addChild(myintro); //doesnt work but why cant I add this line?***~
[LEFT]////ClassIntro
[/LEFT]
private function imageLoaded(event:Event):void
[LEFT]{
[/LEFT]
var image:Bitmap = new Bitmap(event.target.content.bitmapData); [LEFT]
IntroCanvas.addChild(image);
IntroCanvas.x = 0;
IntroCanvas.y = 0;[/LEFT]
IntroCanvas.addEventListener(MouseEvent.CLICK ,doSomething); //for this to work i must add the image to the sprite