10 Replies Latest reply on Apr 26, 2006 9:38 AM by dawu

    Scrolling on RollOver?

    dawu Level 1
      I have this actionscript that I got from a tutorial book:

      _root.onEnterFrame = function() {
      CEmenu._x = CEmenu._x+(0.25*Stage.width-_xmouse)/50;
      };

      It activates the scrolling effect on the first frame, but I only want it to activate when the mouse is over the object. Can someone help me adjust this script?

      Thanks!
        • 1. Re: Scrolling on RollOver?
          DavidMLevine
          try

          on (RollOver) {
          CEmenu._x = CEmenu._x+(0.25*Stage.width-_xmouse)/50;
          }
          • 2. Re: Scrolling on RollOver?
            dawu Level 1
            it gave me this error message:

            **Error** Symbol=CE-MC, layer=AC, frame=1:Line 1: Mouse events are permitted only for button instances
            on (RollOver) {

            What I have is a movieClip with three + buttons to scroll.
            • 3. Re: Scrolling on RollOver?
              DavidMLevine Level 1
              which object are you trying to make the rollover on? are the buttons embedded in the movie clip?
              • 4. Re: Scrolling on RollOver?
                dawu Level 1
                Yeah, the buttons are embedded in the movie clip.

                CEmenu has the three MC buttons to scroll. CEmenu is in the CE-MC movie clip. CE-MC is on the root level
                • 5. Re: Scrolling on RollOver?
                  dawu Level 1
                  I have two MC with the current actionscripts: CEmenu and UEmenu. Only CEmenu works but still scrolls off the browser. Can someone assist me?
                  • 6. Re: Scrolling on RollOver?
                    TiJayOldroyd
                    try putting an absolute target before the on(RollOver) it may be that the MC inside the scrollbar MC can't be targetted because when your mouse is over the larger bar it doesn't register which PART of the MC it's over. A workaround I have used before was to create seperate movieclips, and embed them on the stage where they should go making it look like 1 MC, then had the mouse events for each seperate MC...that may help
                    • 7. Re: Scrolling on RollOver?
                      dawu Level 1
                      you mean like this, CEmenu.on(RollOver) ?
                      • 8. Scrolling on RollOver?
                        TiJayOldroyd Level 1
                        that or:

                        this.CEmenu.on(rollover)

                        or:

                        _root.CEmenu.on(rollover)

                        one thing I did just notice...i've never tested this, but if the text color doesn't change when I type it, i just consider it wrong in the AS. on(RollOver) doesn't change to blue, but on(rollover) does...it may be case sensative...try that out...

                        and that was me being enough of a n00b for everyone here for the day

                        (Noob comment was in reference to my OCD, not my advise - it still may work )
                        • 9. Re: Scrolling on RollOver?
                          dawu Level 1
                          Thanks you! You've been very helpful! Hopefully, this will be my last problem

                          I have this AS now:
                          sPane.onRollOver= function() {
                          slider._x = slider._x+(0.25*Stage.width-_xmouse)/60;
                          };

                          It scrolls one pixel when I roll over the sPane. Is there a way to make it scroll continuously without rolling out and back over the sPane?

                          Thanks in advance
                          • 10. Re: Scrolling on RollOver?
                            dawu Level 1
                            Hopefully, this will be my last problem

                            I have this AS now:
                            sPane.onRollOver= function() {
                            slider._x = slider._x+(0.25*Stage.width-_xmouse)/60;
                            };

                            It scrolls one pixel when I roll over the sPane. Is there a way to make it scroll continuously without rolling out and back over the sPane?

                            Thanks in advance