SchmackLab
December 9th, 2008, 04:08 PM
I keep getting "TypeError: Error #1009: Cannot access a property or method of a null object reference." and I don't understand why.
What I am trying to do is to communicate from inside a movieclip nested in the main timeline to another movieclip nested on the main timeline. And I assume that this is why I am getting the error although I do not understand why or how to fix it.
more details and my code:
I have a menu nested in a movieclip on the main timeline that when activated creates a fog over the images in the background. A series of buttons appear that when clicked removed the fog and play individual movieclips nested in the main timeline.
I am trying to create a rollover that will preview the movieclips before you click on them and confirm your choice.
cutlery_btn.addEventListener(MouseEvent.MOUSE_OVER , onRollOverCutlery);
cutlery_btn.addEventListener(MouseEvent.CLICK, onClickCutlery);
function onRollOverCutlery(event:MouseEvent):void
{
MovieClip(root).cutlery_mc.gotoAndStop(10);
}
function onClickCutlery(event:MouseEvent):void
{
MovieClip(root).gotoAndPlay("cutlery");
MovieClip(root).menuTab_mc.visible = false;
MovieClip(root).fog_mc.play();
}
Thanks for your help!
What I am trying to do is to communicate from inside a movieclip nested in the main timeline to another movieclip nested on the main timeline. And I assume that this is why I am getting the error although I do not understand why or how to fix it.
more details and my code:
I have a menu nested in a movieclip on the main timeline that when activated creates a fog over the images in the background. A series of buttons appear that when clicked removed the fog and play individual movieclips nested in the main timeline.
I am trying to create a rollover that will preview the movieclips before you click on them and confirm your choice.
cutlery_btn.addEventListener(MouseEvent.MOUSE_OVER , onRollOverCutlery);
cutlery_btn.addEventListener(MouseEvent.CLICK, onClickCutlery);
function onRollOverCutlery(event:MouseEvent):void
{
MovieClip(root).cutlery_mc.gotoAndStop(10);
}
function onClickCutlery(event:MouseEvent):void
{
MovieClip(root).gotoAndPlay("cutlery");
MovieClip(root).menuTab_mc.visible = false;
MovieClip(root).fog_mc.play();
}
Thanks for your help!