Help with dynamic menu

Hi all,

I am having problems with a dynamic menu I modified from Sorcerer’s super cool dynamic sub menu he posted a little while ago. I am having two basic problems:

  1. The labels on the sub buttons do not display even though they load the correct movie. The labels on the main buttons display fine, which is weird since the label function is a nested for loop for both main and sub labels.

  2. No matter where I place the top level button instance on the main stage it defaults to top left corner when the movie is tested.

Any help out there? :beam:

bump :wink:

is that the right term?

hello hello? anyone out there?

Fixed the placement-on-the-stage problem by putting the whole thing into another movie clip but am still having trouble with sub labels. Whole thing can be downloaded at:

www.humboldt.edu/~mgk9/fla.zip

Where or where are the gurus?

(-:

:q: :q: :q: :q: :q:

I would be ever so grateful if someone could help me figure out why my labels aren’t loading!

:crazy:

Sorry for the long time for a reply.

I notice your menu doesn’t retract when clicked either. I don’t feel like rooting through all that code so I don’t know the problem, but if you don’t mind using XML for this you can check out a menu Senocular and I did (mostly him) here…

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=13697

It dynamcally loads the information via an external .xml file.

Hey all right, I got one of THE gurus! Love your webpage by the way.

Yeah, I know the sub menu doesn’t retract and I can’t figure out why. If I DON’T put the whole drop down thing into a movie clip (the Menu MC) then it works fine:

www.humboldt.edu/~mgk9/orig.zip

But then I have the problem with not being able to place the menu where I want on the stage (keeps defaulting to upper left corner).

I’ve seen the xml driven submenu on the umbc site (that’s senocular’s site right?) and really loved it but unfortunately I know diddly about XML. I’d love to learn but have to get this project moving now.

I know you are super busy and I hate to ask anyone to dig through the code but maybe just look at the label function that is in the actions layer? It’s on the main stage in the above zip. This fla works better than the one I posted earlier anyway.

Thanks so much for your help!
=)

You don’t really need to know about XML to edit the file if you use the other entries as a guideline to go by. You can edit an XML file in a standard text editor such as notepad on Windows.

I will check out this file later tonight.

Thanks LIB, I really appreciate it! I will try the menu you and Senocular did. Would I make the whole thing into it’s own MC to put on my main timeline? Or try to cut and paste everything?

:block:

Hey LIB, your footer changes everytime I log on - cool! Better than my friend changing her answering machine every week . . . :wink:

I tried the xml menu but couldn’t figure out how to load external movies (instead of a url). Actually I’ve got two external movies to load into two container clips per button. I am a little hesitant to bust into the AS as I don’t know much about child objects and nodes, etc.

So I think for now I’m going to stick with the actionscripted dynamic menu. Still can’t figure out why the sub menu labels don’t appear when they are in the same “for” loop as the top button labels. Makes no sense. Is there a way to trace what is going on?

Thanks for any help - this is really bugging me! :hair:

It’s really easy to edit the code for load movie…

In the script you will see 3 onRelease statements. You only need to edit two of them…
[AS]mySubButton.onRelease = function() {
//getURL(this.myUrl, “_blank”);
trace(this.buttonLabel.text+" : "+this.myURL);
};[/AS]

and
[AS]myButton.onRelease = function() {
//getURL(this.myUrl, “_blank”);
trace(this.buttonLabel.text+" : "+this.myURL);
};[/AS]

Now just change the actions in there to your loadMovie() actions, and set this.myURL as the url to your file. [AS]clip.loadMovie(this.myURL);[/AS]

And then in the .xml file change the URL attribute to the URL of the file you are loading and all should be well :slight_smile:

Hey LIB, thanks, but I don’t think I get it (sorry, sorry, I’m an XML idiot).

I want to have a 2nd MC load into another container clip when the same button is pushed. The 2nd MC will contain interactive controls for the 1st external MC. I got it to work in the original file (see above posts) but how do I do that with XML? Do I have to create a 2nd child node?

Sorry if these are stupid questions.

Never mind, I AM an idiot!! I got it to work - thanks Lost In Beta, this is really great! I can’t believe how awesome this community is!

:love: :thumb:

Wow, took 8 minutes to fix it yourself… congrats!! :thumb: :beam:

I am glad you got everything working :slight_smile:

Question1 - Is there any way to set the starting position of the top button? It defaults to the upper left corner and I’d like to have it in line with other objects on my scene. Do I need to define the x and y position when an empty movie clip is created in the first few lines of the AS on the mainstage? (as in: “scope.createEmptyMovieClip(“mainMenu”,2)”).

Question2 - I have a dynamic text box on the stage with a Var name of “map_title” and no instance name. What would be the code to get the subitem name to load into the text box as well as appear on the menu button? I thought it would go in the on release section with the loadMovie commands but nothing I do works. Do I need to give it an instance name instead of a var name? Or both?

Sorry for so many questions - any help is as usual so greatly appreciated. Thanks again!

OK, for that… Hrrmm, it’s within a lot of code to I will go by line number (assuming you got the last version of the menu from this page… http://www.kirupaforum.com/forums/showthread.php?s=&threadid=13697&perpage=15&pagenumber=4 )…

This is going by if your actions panel is set to Expert Mode…

On line 127, there is this code…[AS]myButton._x = myButton._y=16;[/AS] That sets both the _x, and _y positions to 16. You can either change 16 to set the _x and _y positions to a new position using the same number (ex: (100,100) or (200, 200)) or you can seperate them for seperate coordinates… [AS]myButton._x = 100;
myButton._y = 50;[/AS]

Then on line 133 the same line occurs, you can edit that the same way as the above.

Dude you are fast! I was editing my last post as you were posting a response . . .

Sorry I didn’t see those x and y coordinates. I should have figured that out. :trout:

Any ideas on loading the dynamic textbox?

Am I totally abusing your help today or what? :whistle:

Ok, for the textbox thing…

Create your textbox on the stage, and give it the <B>instance</B> name of “titleLabel” (no quotes).

Now in your script, you will edit the onRelease code where you loadMovie was. You will add this code into the onRelease…[AS]this._parent._parent.titleLabel.text = this.buttonLabel.text[/AS]

The targeting may be different depending on how your setup is, but that should work.

Dude, I hope whomever you are working for is paying you a lot of money because you are a freakin GENIUS.

Thanks for all your help man, I’m gonna leave you alone now for awhile!

Yeah! :stuck_out_tongue:

LOL… currently unemployed, but thanks :slight_smile: I hope to work for someone who is willing to pay me a lot of money :evil: :bad:

I am glad I could help :slight_smile: