PDA

View Full Version : Making a Menu


rjschie
08-05-2008, 08:00 PM
Hey,

I have a nested movie clip called "menu". In that mc I have another called "button1" that is only on frame 10. On frame 10 of the "menu" is a script:

button1.addEventListener(
MouseEvent.MOUSE_UP,
function(evt:MouseEvent):void {
this.sections.gotoAndStop("spaCap");
}
);

Now I would like this script to go to a frame labeled "spaCap" of a movie clip called "sections" which is actually on the same level as "menu".

This script runs and i get the error:

TypeError: Error #1010: A term is undefined and has no properties.
at MethodInfo-26()

I think it has something to do with the script being on frame 10, but I put it on frame 1 and it did the same thing. What should I do?

dualpixel
08-05-2008, 08:10 PM
In your code,

button1.addEventListener(MouseEvent.MOUSE_UP, yourFunctionName); //you need to insert function name here
function yourFunctionName(evt:MouseEvent):void { // you need to call your function here.
this.sections.gotoAndStop("spaCap");
}
);

rjschie
08-05-2008, 08:17 PM
I copied your code and then edited the names of the function

button1.addEventListener(MouseEvent.MOUSE_UP, linkSpaCap);
function linkSpaCap(evt:MouseEvent):void {
this.sections.gotoAndStop("spaCap");
}

(that last ");" wasn't supposed to be there, I got an error)

but after using that code I get an error:

TypeError: Error #1010: A term is undefined and has no properties.
at relaxationStation_fla::menu_2/linkSpaCap()