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:
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.
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.
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:
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…
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.
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.
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?
Hey LIB, your footer changes everytime I log on - cool! Better than my friend changing her answering machine every week . . .
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:
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]
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?
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!
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.
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.