Skip to main content
January 23, 2008
Question

How do I make multiple buttons in my flash animation?

  • January 23, 2008
  • 1 reply
  • 874 views
I am new to flash, and I have no training in it whatsoever. I created a flash animation with flash CS3 for my photography website, and I want to link each of the images to different galleries on my site. When I created my first button it worked fine, but when I try to create actions to link more than one image as a button, keep getting an error that says "1021: Duplicate function definition." How do I make each image as a separate button?

I used the video of this tutorial as my guide to learn how to create a button:
http://www.adobe.com/designcenter/flash/articles/flacs3it_firstflash_pt1.html

I used the method shown in the tutorial I mentioned to create it (created a new layer for the button, selected the area of the image for the button,used modify -> convert to symbol
-> button, I edited it so it was an invisible button by moving it to the hit frame, gave the selected area an instance name of Hizumi_btn, inserted a new layer for actions and added the code I have attached to this post.

I assumed that I would just need to repeat this procedure for each of the other images in my animation, but when I did that I received the error.

I greatly appreciate any help you can give me.

Here is the code I used to create my first button.

This topic has been closed for replies.

1 reply

Inspiring
January 23, 2008
Hi. You need to have a different function name for each function. They can't all be named as "buttonClickHandler".

For instance, your functions could be named as:
buttonClickHandler1
buttonClickHandler2
etc

Or you could (and should) use names that are more descriptive.

>> keep getting an error that says "1021: Duplicate function definition."
January 25, 2008
Thanks for the help.

Is there anything I need to include in the function names I use, or can I call them anything I want?