flash help
- Started
- Last post
- 5 Responses
- Spix
how can I get this to work like I want it? im trying to make a dropdown menu using this code:
// make mc_2 hidden on load
mc_2._visible = false;//show mc_2 on rollOver
mc_1.onRollOver = function(){
mc_2._visible = true;
}//hide mc_2 on rollOout
mc_1.onRollOut = function(){
mc_2._visible = false;
}so it works until i move the cursor over the mc_2 then it off course gets hidden again..so I changed
//hide mc_2 on rollOout
mc_1.onRollOut = function(){
mc_2._visible = false;
}to
//hide mc_2 on rollOout
mc_2.onRollOut = function(){
mc_2._visible = false;
}but then the buttons that Ive put on mc_2 dont work...
but they work if I take the hide on roll out completely??? what can I do? I suck at flash as u can see...
any help is appreciated..
thanks.
- Crouwel0
i will bump this as i feel sorry for this being the only unanswered thread on the frontpage.
- alloyd0
Just check to see if it is already invisible using an if/else statement. ie:
mc2 on roll out
if( ! this._visible){ this._visible; mc_1._visible = false;}
volia. happy new years.
- alloyd0
I forgot to put this._visible = true;.
There are many ways to do this btw. Since you are only working with two items, that might be the easiest solution though. Making a prototype function might be an easier solution if you are working with many. That would be one function that cycles through an array of movieclips and checks to see if the visibility of each clip is false, basically turning all of the clips off, and then after that turning the one you called it with on. Look up how to write functions/prototypes, arrays etc in the Flash Help. Once you learn that it will make everything else a lot easier.
- Spix0
thanks Crowel and alloyd... I will try that.
- caseyc0
Here u go: