Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drop down menu commands?

Status
Not open for further replies.

jreley

Technical User
Sep 11, 2006
14
0
0
GB
I have a drop down menu that is a movie clip that works fine, but i need to be able to set the buttons within the drop down menu to goto the main scene to a certain frame. I've tried to do this but cant get it to work. the buttons work if i set them to goto a frame within the movie clip of the drop down menu, but that would mean bringing everything from the main scene into that movie clip and also the drop down menu itself disappears.

Is there anyway to tell a button within a drop down menu to goto different scenes and certain frames?

Any help would be appreciated
 
You need to target the goto link with _root i.e. _root.gotoAndPlay(3); This targets the link to the root timeline.
For future reference, avoid using scenes and stick to using MCs and loading in seperate SWFs to keep your projects organised.
 
Hi digitalpencil and jreley,

I am having a similar problem to you jreley and have tried using digitalpencil's response, but i cannot get my drop down menu to work. I am new to Flash and have followed a tutorial for creating the drop down menu, but cant get the buttons to work. It probably sounds stupid to you guys, but where do i input _root etc?

I have a menu item, then under that i have 3 options for the user to go to. THese options then go to different frames on scene 1.
e.g

something (main heading)
work
cv (options)
links

I have found the _root in the actions but on which section/ frame do i attach this too? is it the main heading on the timeline for scene1 or actually once i am in the mc??
Hope this makes sense?!!!!

Any help would be much appreciated.

carrie1
 
Um, assuming I understand. all you have to do is add
_root.gotoAndStop(main timeline frame number);

on each button on your drop down menu. so you would add this to work, cv, and links.

Assuming these are buttons (as you can use mc's as well).

so it would look like this on each button
_root.gotoAndStop(3);

if you want to play more than frame 3, persay, you wanted it to run from frame 3 to frame 9 on the main timeline, you would use a gotoAndPlay function...

_root.gotoAndPlay(3);

then put a stop command on your main timeline on frame 9.

hope this might help.
 
yeh, basically I would think, for simplicities sake (although not always the best practice) you want to put the code in the actual MC..
the problem is that if you don't target the goto command, then the flash player will attempt to goto within that clip.
Therefore in this case, to control the main timeline we use _root. There's also _this and _parent but you'll have to look all this up if you want further clarification.
Anyway, if you we're using an MC as a button and wanted to nav the root timeline to frame 3 you would have to instance name the button MC and use the following code:
buttonone.onRelease = function() {
_root.gotoAndPlay(3);
 
IMHO, it's also a bad idea to target a frame number, and always better to target a labeled frame...

From a movie clip, one level deep, you can use either _root, _level0 (same as _root - both absolute paths) or _parent, which is a relative path...

my_btn.onRelease = function(){
_root.gotoAndPlay("frame_label");
//Or...
//level0.gotoAndPlay("frame_label");
//Or...
//_parent.gotoAndPlay("frame_label");
};

Regards. Web Hosting - Web Design
03/13/05 -> OLDNEWBIE VS FLASHKIT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top