Hello -
I’m really stuck. Can someone please help me? I have a movieclip that needs to “dim” (change in alpha value) when you hover above it. Easy. However, while it’s opacity decreases some text also needs to appear directly above the dimmed movie clip.
My solution was to place an invisible button over the movieclip. This button has the text on its Over state. So far so good.
However, when I click the button so I can go somewhere else in the timeline, I’m getting the following error:
“TypeError: Error #1009: Cannot access a property or method of a null object reference.TypeError: Error #1009: Cannot access a property or method of a null object reference.”
Here’s my code:
//Go to frame "Test" when the invisible button is clicked.
function clickFunction(evt:Event):void {
gotoAndPlay("Test");
}
invisibleButton.addEventListener(MouseEvent.CLICK, clickFunction);
//Dim the menu icon movieclip when you hover
function overFunction(evt:Event):void {
movieClip.alpha = 0.2;
}
invisibleButton.addEventListener(MouseEvent.MOUSE_OVER, overFunction);
//Reset the movie clip opacity when you exit
function outFunction(evt:Event):void {
movieClip.alpha = 1.0;
}
globeButtonOne.addEventListener(MouseEvent.MOUSE_OUT, outFunction);
stop();
I think it has something to do with the alpha reset needing to happen before running the clickFunction. Please help!