all groups > macromedia flash sitedesign > october 2006 >
You're in the

macromedia flash sitedesign

group:

Creating animated buttons in a menu



Creating animated buttons in a menu ConfusedinFlash
10/30/2006 5:01:17 PM
macromedia flash sitedesign: I am trying to build a flash website with an animated menu at the top. Here is
how I did it:

Each element of the menu is a movie clip. Within the movie clip, there is a
motion tween that animates the menu item. Over the motion tween is an invisible
button with the following script:

on (rollOver) {
gotoAndPlay("startmotion");
}

on (rollOut) {
gotoAndPlay("finishmotion");
}
on (release) {
gotoAndPlay("about", "about1");

In the "on (release)" script, "about" is the scene I want to the button to go
to, and "about1" is the frame label in the "about" scene that I want to start
on.

The rollovers and rollouts work perfectly, but when I click on the buttons
when I'm testing the movie, the buttons do not direct me to any scene. Nothing
happens.

Any thoughts about what I'm doing wrong? I think it possibly has to do with
having the invisible button within the movie clip, but I can't think of another
way to do it. Also, I have tried using _root.gotoAndPlay and that does not work
either.

Thanks in advance for your help!
Re: Creating animated buttons in a menu gerarddaver
11/4/2006 7:29:02 PM
Hello,
I am not sure of what you mean having a link to the site may help..

Try to use fuctions instead and put the script in the movie clip itself

Name the button, eg. myButton_btn,

and then your script....( in an actions layer )
myButton_btn = function () {
gotoAndPlay ("the frame label goes here");
}
for the last one add the
getURL ("name of the page or file");

Hope this helps
G.
Re: Creating animated buttons in a menu clbeech
11/16/2006 6:10:58 PM
yes that's the way. Sounds like you have some pathway problems too. You
shouldn't need to use an 'invisible' button. any movieclip can be used as a
button without converting it to one. if you call the movieclip instance name
like :

yourMovieClip.onRelease = function() {
_parent.gotoAndPlay("yourFrameLabel");
}

I've guessed '_parent' here because I'm assuming that your button_MC is one
level deep above your main timeline, that your trying to call. but if it was
anywhere, in any MC you can get there by calling the correct path, and
sometimes this can get complex.

Also this code should not be attached to the button, but on the main timeline,
or within the button_MC's maintimeline in a new layer called 'actions'.

learnFlash.com rocks! craig is great help to start off. Goodluck
AddThis Social Bookmark Button