# Movieclip scrolling fixed X and Y path?

**URL:** https://forum.kirupa.com/t/movieclip-scrolling-fixed-x-and-y-path/280002
**Category:** flash
**Created:** [January 21, 2009, 3:20pm UTC](https://forum.kirupa.com/t/movieclip-scrolling-fixed-x-and-y-path/280002 "2009-01-21T15:20:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Marije](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@Marije](https://forum.kirupa.com/u/Marije)
#### Post date: [January 21, 2009, 3:20pm UTC](https://forum.kirupa.com/t/movieclip-scrolling-fixed-x-and-y-path/280002/1 "2009-01-21T15:20:37Z")

</div>

I have a gigantic movieclip which is something like 12000 pixels by 2800. As user you scoll through this movieclip. The x scrolling is always 20 pixels but the y scrolling changes a lot, you follow a line who moves randomly up and down (it’s a mountain). In the movieclip I have put a lot of walls and when you pass them, the ySpeed changes. it goes something like this:

```auto
      
        public function movemeright(evt:Event) {        

            if (topleft==true) {
  if (camerastage.hitTestObject(mountain.cameramove_1)) {
                bergsnelheidY=10;
                trace("1");
            }

            if (camerastage.hitTestObject(mountain.cameramove_2)) {
                bergsnelheidY=-4;
                trace("2");
            }

            if (camerastage.hitTestObject(mountain.cameramove_3_1)) {
                bergsnelheidY=0;
                trace("3.1");
            }

            if (camerastage.hitTestObject(mountain.cameramove_3)) {
                bergsnelheidY=20;
                trace("3");
            }
            rightMoveTween()
        }

public function rightMoveTween():void {
    TweenLite.to(mountain,mountaintime, {x:mountain.x-standaardsnelheid, y:mountain.y+bergsnelheidY});
}

```

This is only a snippet and it seems in my eyes really time-consuming, it could be a lot more compacter I think. Is there a way where I can say: the Line.mc has always to be 100 pixels above stage.width?
