2 Replies Latest reply on Apr 28, 2006 12:37 PM by shyaway

    Setting button rollOver state via script

      I'm creating a separate "dropdown" menu when a button is rolled over. Can I put script in the dropdown so that it will cause the button to stay in its rollOver state when the cursor is actually over the dropdown clip instead of the button? I'm sure doing this with movie clips is probably more practical, but I've already got the top level buttons designed!

        • 1. Re: Setting button rollOver state via script
          Simon Bailey
          I think the best way to do this Jerry is to create a seperate layer on each of your buttons and create labels on each frame above the default button states you already have in place. Then target you button accordingly and reference the frames i.e. gotoAndStop("rollover");

          Just a quick google search came up with this oldish article digress on my point (personally I would use movieclips to do all this though mate)....



          • 2. Re: Setting button rollOver state via script
            so, you want the rollover state for active/current selected item.
            you already have buttons created.
            first step, convert your button into MovieClip
            you can do that easily from the library, right click and then set the type.

            now, you want your MC to have 2 frames, first frame is rollout state and second frame is rollover state.
            each frame will have a stop();

            next, you want a function to turn off all buttons to rollout state for convience.
            function buttonsOff(){
            for each mc in list{
            mc .gotoAndStop(1);}

            now, for each buttons (note that when i say buttons, i am talking about the mc's), have a rollover script as,

            my_mc.onRollOver = function(){

            that's it, the only "active" button is the last one that you moused over.

            don't just paste my codes, it's pseudo