Solved

Making a flash button do two things at once.

Posted on 2008-06-19
18
397 Views
Last Modified: 2013-12-24
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
0
Comment
Question by:ScottH0221
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 8
18 Comments
 
LVL 13

Expert Comment

by:crooksy88
ID: 21822388
on (release) {
_root.menubar.gotoAndPlay(15);
_root.gotoandPlay(56);
}
0
 
LVL 13

Expert Comment

by:crooksy88
ID: 21822397
spotted the lowercase A in your code. It should be:

on (release) {
_root.menubar.gotoAndPlay(15);
_root.gotoAndPlay(56);
}
0
 

Author Comment

by:ScottH0221
ID: 21822452
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Expert Comment

by:crooksy88
ID: 21822659
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
 

Author Comment

by:ScottH0221
ID: 21823005
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
 
LVL 13

Expert Comment

by:crooksy88
ID: 21823483
Have you tried running the example I have supplied? This does both commands.

Have you get 568 frames on the root?
0
 

Author Comment

by:ScottH0221
ID: 21823580
i couldn't open the attachment are you working on a mac?
0
 
LVL 13

Expert Comment

by:crooksy88
ID: 21823622
Yes but that shouldn't be an issue. Have you got Flash CS3 or Flash 8?
0
 

Author Comment

by:ScottH0221
ID: 21823753
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
 
LVL 13

Expert Comment

by:crooksy88
ID: 21823848
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
 

Author Comment

by:ScottH0221
ID: 21823914
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
 
LVL 13

Expert Comment

by:crooksy88
ID: 21824008
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
 

Author Comment

by:ScottH0221
ID: 21824065
0
 

Author Comment

by:ScottH0221
ID: 21824345
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
 
LVL 13

Expert Comment

by:crooksy88
ID: 21824781
OK I've downloaded the file but I can't see anywhere that you are trying to do two gotoAndPlay's at once?
0
 

Author Comment

by:ScottH0221
ID: 21824869
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
 
LVL 13

Accepted Solution

by:
crooksy88 earned 500 total points
ID: 21825006
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question