Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
| Subject: | RE: [flasher] Can anyone help with a dynamic menu which has 80 (or more) clickable options? |
| From: | AndyA |
| Date: | Wed, 14 Mar 2001 06:44:21 -0000 |
Hi Harriett,
I'm not sure I understand entirely what you are after... but here goes:
If you make a single button of the right design (let's call it buttonMC)
with a text variable in it called varText then you can do the following.
Create a button of your own in a movieclip in which you place an invisible
button (one with just hit area defined) to attach the actions to. Then use
duplicateMovieClip to create the new buttons in run time and set the text in
each one at creation time...
so
i=1
while (i<=80) {
duplicateMovieClip (_root.buttonMC, "Button"+i,i)
_root["Button"+i].varText = "Button "+i
i = i+1
}
This will step through values of i, create a new button movieclip called
Button1, Button2 etc and then sets the button text to "Button 1" Button 2"
etc. You can also set other things in the movieclip like the frame it should
target:
_root.Button1.targetFrame = "Blah"
_root.Button2.targetFrame = "Blob"
and then in the invisible button of your original movieclip you add
on (release) {
_root.gotoAndPlay (this.targetFrame)
}
which would make Button1 tell the main timeline to go to the label "Blah"
and play but Button2 would tell it to go to the label "Blob".
this way, your download will be small, because the user downloads just one
button instance and the others are created at run time. It's a little more
complicated in programming though, because the programming has to be the
same for every button
Hope to have helped.
Andy
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]

