View Full Version : animated button using movieclip
lazerbrains
04-19-2006, 09:32 PM
I am trying to have a button that has an animated doprdown menu that eases into place. The way I have it setup now is the main button is a movieClip symbol and inside of that, is another movieClip symbol that is the drop down menu. Indside of that are four buttons that are also movieclips. Is this possible? Can I hav a movieClip that is inside of a movieClip that is inside of a movieClip? Or am I going about this all wrong?
Any input would be a ppreciated.
Paerez
04-19-2006, 10:06 PM
yes, you can have movie clips inside movie clips, BUT only one layer can have mouse actions. So this will not function as a menu. Search for "flash event bubbling" and you'll get a lot of info on this. You are going to have to keep the movieclips seperate from each other to have clicking.
Also oldnewbie has some examples floating around of using hittest instead of onRelease, which lets you have MCs inside MCs.
lazerbrains
04-20-2006, 07:08 PM
OK, I have found some information on Event bubling, and it makes sense. Correct me if I am wrong, but I need to put all the actionscript on the last embedded movieClip, right? so if I have the main button_MC, and then inside that I have the dropdown_MC, and inside that i have four buttons (all movieclips). Then the the code and event handlers need to go on those buttons correct? i have read through this article, http://www.senocular.com/flash/tutorials/buttoncapturing/ (which is very indepth) but I am not sure I am right in my thinking. But if those buttons are the ones with the code, how would they get triggered if they aren't visible yet?
Paerez
04-26-2006, 07:34 PM
It is really confusing. The only solution I have used (other will work too) is to keep all the movie clips on the same level, and have each movie clip have mouse events that show/hide and position the children clips.
So you root menu is _root.menu, then you have _root.about _root.home, etc for each item in the menu. Then _root.menu.onRollOver makes about and home all show up. Now do the same for about's rollover with about's children.
Its kind of like a fake nesting of clips. Confusing though.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.