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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menu button in nested mc not working (client getting impatient...) 1

Status
Not open for further replies.

dnfGraphics

Technical User
Jan 28, 2004
8
US
Greetings,
I am creating a dropdown menu in an all-flash site. I finally got the menus to drop and disappear (including a set of sub-menus), but I can't get the buttons to actually move the swf to the desired frame.

It is set up to rollover the menu title, drop down the submenu, and click the button. The submenu is a movieclip with 2 frames. The menu items are on frame 2. Frame 1 is a stop() frame.

I tried to set the button itself with action to gotoAndStop(23) (for example). No good. I tried using:
Code:
_root.submenu2.button2.onPress = function() {
	_root.gotoAndStop(23);
};
No good.

Thanks for your help.
Happy New Year!

Peace, Love & Prosperity!
 
For further clarification you can get the .fla from . Sorry the file is so big. I deleted all the graphics out of it, don't know why it didn't get smaller.

Anyway...
The button in question is Company>Profile. (I would have tried Mission Statement first, but wasn't sure if the fact that the text completely covers the button would prevent it from working).

The top three layers: scripts, menu and submenu control the menus. Under scripts, it is the last action item that I am trying to get to work. Presumably once one works, I'll be able to get them all to work...

Thanks again!
 
A few syntax errors...

From...

_button2.onPress = function() {
_parent._parent.gotoAndStop(23);
};

To...

button2.onPress = function() {
_parent.gotoAndStop(23);
};

Even suggest you target a labeled frame rather than a frame number. Thus labeled frame 23 with an unique label such as profile or whatever suits you (no number only labels or at least not starting off with a number), and target that labeled frame...

button2.onPress = function() {
_parent.gotoAndStop("profile");
};

 
Hi oldnewbie,
I appreciate the fast response. Unfortunately, it didn't work. I now have:
Code:
_root.submenu2.button2.onRelease = function() {
    _parent.gotoAndStop("Profile");
};
But it's not working.

I also tried
Code:
submenu2.button2.onRelease
and just plain old
Code:
button2.onRelease
but nothing seems to be working.

Any other suggestions?
Thank you.


Peace, Love & Prosperity!
dnfGraphics
 
Did you update the above zip package with this new corrected .fla?
 
Ok, now I'm completely freaked out. It's still not working for me.

No, I hadn't update the HELP.zip.

Yes, the P in Profile is capital in the Frame ID and the code.

Thanks for the heads up on the 22/23 issue. I'll fix it as soon as I stop beating my head against the wall.

My click is still not responding.


Peace, Love & Prosperity!
dnfGraphics
 
Perfect! What happened? And did your file get down to 95K and mine is 15MB?

I'd love it if you had answers, but even if you don't THANK YOU THANK YOU!


Peace, Love & Prosperity!
dnfGraphics
 
Hi oldnewbie,
I'm really confused. The file you gave me is set to go to frame 23. As you pointed out, Profile is on 22. Yet when you click the Profile button, it goes to the profile page which is 22, but the code is set to go to frame 23.

How is this possible?
Thanks again.


Peace, Love & Prosperity!
dnfGraphics
 
I found what I missed. I was looking at the code on the "scripts" layer and you put code inside the mc. I get it now. Thanks again.

Still wondering why your file reduced in size and mine is still bloated....

THANKS.


Peace, Love & Prosperity!
dnfGraphics
 
No! You're talking about your script on the first frame of your movie. That script does nothing since you can't assign a button's handler if the button is not present, on stage, and on the frame the handler is defined.

I'm talking about the script on the second frame of your submenu2 mc... There the button is present, so you can assing a handler to it.

Check it out!

And I guess this post
was helpful!
 
As for the file size, when deleting stuff, it won't change unless you use Save As, under another name. Then the file's size will be reflected!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top