Skip navigation
i2004shinc
Currently Being Moderated

multi-level roll over drop down menu problem!!

Mar 6, 2012 7:32 AM

i got the drop down menu to come down once rolled over but it cancels out all other actions meaning it cancels the functions of the rest of the menu none of my other buttons work now. how can i fix this?

 

each button has its own action ie:

 

onClipEvent (load) {

          num = 3;

}

on (rollOver) {

          if (_root.link != num) {

                              this.gotoAndPlay("over");

          }

}

on (releaseOutside, rollOut) {

          if (_root.link != num) {

                    this.gotoAndPlay(_totalframes - _currentframe);

          }

}

on (release) {

          if (_root.link != num and _root.animation == 1) {

                    _root.animation = 0;

                    _root.link_prev = _root.link;

                    _parent[("item" + _root.link)].gotoAndPlay("out");

                    _root.link = num;

                    _root.main.play();

          }

}

 

then i created a button to frame the drop down movie and gave it the following action:

 

on(rollOver){

          PastorMenu.play();

}

 

when i try to put in the same as the main button it doesnt come down when rolled over. but done this way it will come down but none of the other main menu buttons work.

 

thanks in advance to anyone who can help

 
Replies
  • kglad
    72,189 posts
    Jul 21, 2002
    Currently Being Moderated
    Mar 6, 2012 7:36 AM   in reply to i2004shinc

    use a loop and hitTest() for your submenu items.

     
    |
    Mark as:
  • kglad
    72,189 posts
    Jul 21, 2002
    Currently Being Moderated
    Mar 6, 2012 8:15 AM   in reply to i2004shinc

    first, remove all code from objects.  it's difficult to debug and maintain and very difficult to help you.  so:

     

    var tl:MovieClip=this;

    yourbutton.onRelease=function(){

    tl.onMouseDown=checkSubmenuF;

    // the rest of you code

              if (_root.link != num and _root.animation == 1) {

                        _root.animation = 0;

                        _root.link_prev = _root.link;

                        _parent[("item" + _root.link)].gotoAndPlay("out");

                        _root.link = num;

                        _root.main.play();

              }

    }

     

    function checkSubmenuF(){

    if(submenuitem.hitTest(_xmouse,_ymouse)){

    // do whatever

    } else {

    // do whatever else

    }

    delete this.onMouseDown;

    }

     
    |
    Mark as:
  • kglad
    72,189 posts
    Jul 21, 2002
    Currently Being Moderated
    Mar 7, 2012 6:54 AM   in reply to i2004shinc

    you assign instance names to everything that needs to be referenced using actionscript and you apply your mouse handler methods to that instance name:

     

    yourbutton.num=3;

    yourbutton.onRollOver=function(){

    //

    }

    yourbutton.onRelease=function(){

    //

    }

     

    yourbutton.onReleaseOutside=yourbutton.onRollOut=function(){

    //

    }

     
    |
    Mark as:
  • kglad
    72,189 posts
    Jul 21, 2002
    Currently Being Moderated
    Mar 7, 2012 9:13 AM   in reply to i2004shinc

    when you move code from a movieclip to a timeline, your paths to other objects will change.  you need to use the correct paths.

     

    you can always use the trace() function to find the path to anything in your app.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points