PDA

View Full Version : Rollover gotoandplay AS3



Evangelizes
February 2nd, 2010, 06:40 PM
Hi, I'm a noob to flash, and any kind of programming.

I made a very simple site with 2 navigation buttons that trigger different content.

The tutorial I followed use AS2, and I am not sure if this is the right code for AS3.

For my first button.
So when you click it changes to plays frame 1.

Code:
bhome.addEventListener(MouseEvent.CLICK,clickFunct ion);

function clickFunction(evt:MouseEvent):void {
gotoAndPlay(1);
}
2nd Button
Plays frame 2.

Code:
babout.addEventListener(MouseEvent.CLICK,clickFunc tion);

function clickFunction(evt:MouseEvent):void {
gotoAndPlay(2);
}

When I test the move the buttons flicker very quickly, and flash says
1021: Duplicate function definition.

If someone can please explain?

Matrix015
February 2nd, 2010, 07:49 PM
you call the two click functions the same thing. Call the bhome clickHomeFunction and the babout clickAboutFunction. I find that using the name of the button in the function helps me to remember what it is for.

Evangelizes
February 2nd, 2010, 08:42 PM
Thanks! I fixed that.
But not when I click either the home or about button they just bring about the opposite frame not the frame I told them to bring

Evangelizes
February 2nd, 2010, 09:44 PM
Alot of views, but no answers!
I'd greatly appreciate if someone could just point me the right direction.
I am attaching the .fla.