TypeError: Error #1009: Cannot access a property or method of a null object reference. at finalportfolio_fla::MainTimeline/rotating()
MY code
stage.addEventListener(MouseEvent.MOUSE_MOVE,rotating);
function rotating(event:MouseEvent):void{
album.rotationX=mouseY-50;
album.rotationY=mouseX-50;
if(album.rotationX>260){
album.rotationX=259;
}
if(album.rotationY>445){
album.rotationY=444;
}
if(album.rotationX<105){
album.rotationX=106;
}
if(album.rotationY<285){
album.rotationY=284;
}
trace("rotation X " + album.rotationX);
trace("mouse Y " + (mouseY+50));
trace("rotation Y " + album.rotationY);
trace("mouse X " + (mouseX+50));
}
stage.addEventListener(MouseEvent.CLICK,changing);
function changing(event:MouseEvent):void{
album.nextFrame();
}
