Making a flash button do two things at once.

I am trying to get a button inside a movie to start another movie and then also goto a certain frame on the _root movie.  I am not having any luck getting this to work.  I am working on the website www.designplaninc.com  I have setup the menu buttons so that when you move your mouse into a certain area that the menu box expands and when you move out the menu box collapses.  But the problem is that when you scroll out of the area to fast it doesn't catch it.  So I wanted to add code to a button that minimized the menu box when it also goes to the frame that you have selected.  Here is the code I am using
on (release) {
      _root.menubar.gotoAndPlay(15);
}

on (release) {
                     _root.gotoandPlay(56);
}

It doesn't see to do anything with the first item and scips down to the _root.gotoandPlay (56)

Any help would be appreciated..

THANKS
ScottH0221Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

crooksy88Commented:
on (release) {
_root.menubar.gotoAndPlay(15);
_root.gotoandPlay(56);
}
0
crooksy88Commented:
spotted the lowercase A in your code. It should be:

on (release) {
_root.menubar.gotoAndPlay(15);
_root.gotoAndPlay(56);
}
0
ScottH0221Author Commented:
No still not working it won't even goto frame 56 now when you put them together.  menubar is the movie clip name is that how it's supposed to be listed?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

crooksy88Commented:
Is it the movieclip instance name? i.e. added to the properties panel?

See the attached file for a working example. download the file and change the .txt to .fla.
The code above is correct.



Untitled-2.txt
0
ScottH0221Author Commented:
ok adding the instance name worked but...

it does the first line but doesn't do the the second

on (release) {
      _root.menubar.gotoAndPlay(16);
      _root.gotoAndPlay(568);
}
0
crooksy88Commented:
Have you tried running the example I have supplied? This does both commands.

Have you get 568 frames on the root?
0
ScottH0221Author Commented:
i couldn't open the attachment are you working on a mac?
0
crooksy88Commented:
Yes but that shouldn't be an issue. Have you got Flash CS3 or Flash 8?
0
ScottH0221Author Commented:
Let me add something...  What I have is a movie inside a movie.  I have a menubar accross the top that acts as a movie and one of the buttons has a submenu which is in another movie and that is where my button is that I am trying to get it to do the action.
0
crooksy88Commented:
I'm sure your problems lie with targeting the movieclips correctly.

You can try this: Select a movieclip and add this code to it. Then test the movie.

on clipEvent(load) {
trace(this._target);
}

This will output the path to the movieclip.

Alternatively you can attached the file and I'll take a look.
0
ScottH0221Author Commented:
i can't send the .fla file is 40 meg....   Don't suppose there is a different way to get to you?  Also do I need to change any of the on clipevent code to label the movie?
0
crooksy88Commented:
No, as long as you select the movieclip on the timeline, then paste the code into the actions panel it will work.

How about zipping the file up and posting it on your website, then send me  a link to it so I can download it.
0
ScottH0221Author Commented:
0
ScottH0221Author Commented:
should probably let you know that the menu bar across is a movie with submenu which is also a movie inside of it.  Let me know if you were able to download
0
crooksy88Commented:
OK I've downloaded the file but I can't see anywhere that you are trying to do two gotoAndPlay's at once?
0
ScottH0221Author Commented:
well if you goto the subbuttons movie and then goto the argosy casino hotel and spa button.  I had...
on (release) {
      _root.menubar.gotoAndPlay(16);
      _root.gotoAndPlay(568);
}

try pasteing that there and you will see what I mean..
0
crooksy88Commented:
I think the problems lie with how you have created the entire movie and unfortunately I can't make sense of what is going on.

Going back to your initial question, the code I supplied does do what you ask, it's just that you have other commands being played all over the timeline so it's extremely difficult to pinpoint the reason why the timeline isn't doing what you want it to.

My suggestion would be that you make a copy of your file, then work on the copy, remove the menu bar altogether, then slowly build it back up, working with simple buttons. Only when you have it working as you want should you look into animating it.

Sorry I can't help any more.

Mark

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development Software

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.