7 Replies Latest reply on Jul 10, 2006 12:39 PM by Andreq85

    Genius Nedded

    mr.nazarko Level 1
      hey....
      ive been wrestling w/ this problem for a few days,
      and havent been able to come up with a solution....

      any direction would help !

      here is the dilemma,

      im working with a parallax scroller ive found on flashkit.
      http://www.popmontreal.com/TEST/TEST2/

      im trying to limit the scrolling activation to within the border...
      so that its not constantly moving around!

      any ideas...where do i start >?

      thanks,
      nazarko

        • 1. Re: Genius Nedded
          Andreq85 Level 1
          OK I did'nt look the code from this parallax scrolling but I think you could just have some limiting code like:

          if (xmouse < 40 || xmouse > 70){
          do the scroll action
          }

          and it should work
          • 2. Re: Genius Nedded
            mr.nazarko Level 1
            thanks,

            ive been messing around with _xmouse....but couldnt come up with anything that works

            this the the scrolling code

            onClipEvent (enterFrame) {
            if (_root.mainVar == 0) {
            homeX = (-_root._xmouse*2.2)+1300;
            } else {
            homeX = (-_root.mainVar*2.2)+1300;
            }
            thisX = _x;
            diffX = homeX-thisX;
            if (_root.mainVar == 0) {
            moveX = diffX/60;
            } else {
            moveX = diffX/40;
            }
            _x = thisX+moveX;
            }

            -----------------------------------------------------------

            how do i incorporate your code into this ?

            thanks,
            nazarko

            • 3. Re: Genius Nedded
              Andreq85 Level 1
              make a big { the scrolling code here } and add this to the if statement and it should work
              • 4. Re: Genius Nedded
                mr.nazarko Level 1
                if (xmouse < 40 || xmouse > 70)
                {
                onClipEvent (enterFrame) {
                if (_root.mainVar == 0) {
                homeX = (-_root._xmouse*2.2)+1300;
                } else {
                homeX = (-_root.mainVar*2.2)+1300;
                }
                thisX = _x;
                diffX = homeX-thisX;
                if (_root.mainVar == 0) {
                moveX = diffX/60;
                } else {
                moveX = diffX/40;
                }
                _x = thisX+moveX;
                }
                }


                ---------------------------------------------------------------------
                sorry doesnt work,

                says it needs to have be in an onEvent handler....
                but you cant nest onevent inside another....
                ?

                thanks,
                nazarko
                • 5. Re: Genius Nedded
                  Andreq85 Level 1
                  ...

                  onClipEvent (enterFrame) {
                  if (xmouse < 40 || xmouse > 70)
                  {
                  if (_root.mainVar == 0) {
                  homeX = (-_root._xmouse*2.2)+1300;
                  } else {
                  homeX = (-_root.mainVar*2.2)+1300;
                  }
                  thisX = _x;
                  diffX = homeX-thisX;
                  if (_root.mainVar == 0) {
                  moveX = diffX/60;
                  } else {
                  moveX = diffX/40;
                  }
                  _x = thisX+moveX;
                  }
                  }
                  • 6. Re: Genius Nedded
                    mr.nazarko Level 1
                    your officially a genius!
                    thanks.....

                    it was reversed so added an "else"

                    ------------------------------------------------------------------------
                    onClipEvent (enterFrame) {
                    if (_root._xmouse > 700 || _root._xmouse < 200 )
                    {}
                    else{
                    if (_root.mainVar == 0) {
                    homeX = (-_root._xmouse)+600;
                    } else {
                    homeX = (-_root.mainVar)+600;
                    }
                    thisX = _x;
                    diffX = homeX-thisX;
                    if (_root.mainVar == 0) {
                    moveX = diffX/60;
                    } else {
                    moveX = diffX/40;
                    }
                    _x = thisX+moveX;
                    }
                    }
                    -------------------------------------------------------------------
                    • 7. Re: Genius Nedded
                      Andreq85 Level 1
                      an empty if is quite ...stange and useless

                      if (!(_root._xmouse > 700 || _root._xmouse < 200 ))

                      the ! is like if(NOT(statement))