hello everybody!

im developing a mobile skiing game for a school project with moscrif (www.moscrif.com). it uses javascript and automatically creates native code. anyways, my current task is to make the ski-slope move/scroll according to the input from the devices sensor. its supposed to be tilt-controlled. im very new to all this so i really need some help. i got the downwards scrolling just fine but now im stuck with the left/right directions :-(

heres my code for the down-scrolling (x is the sensor input for x-axis)
Code:
timing.onTick = function(tilt)
            {
                //scrolling down
                if(x>1)
            {
                    game.scene.piste.action = #down;
                    game.scene.piste.stepX+=x*10;

                    game.scene._start.visible=false;
                    this.visible=false;

            }else{
                game.scene.piste.action=#wait;
            }
heres where the #down property is defined:

Code:
function process()
    {
        
        // change if it is time to change the frame
        if (System.tick - this._lastFrameChange > this._timeGap) {
            
            // save current time
            this._lastFrameChange = System.tick;
            if (this.action == #down)
            {
                // do not move out of the screen
                if (this.viewX < this.frameWidth){
                    this._action = #wait;
                }else{
                    this.viewY += this.stepX;
            }
            }
this is the property for the speed (i have a seperate stepX and stepY):
Code:
property stepX(v)
    {
        get return this._stepX;
        set {
            if (v<9)
            {
                this._stepX = v;
            }
            else {
                this._stepX = 9;
                this._fps += 30;
                this._timeGap=1000/this._fps;
            }
        }
    }
now i tried to do the same for the left/right movement by doing this:
Code:
 //scrolling left/right
            if(y>1){
                game.scene.piste.action = #right;
                game.scene.piste.stepY+=y*10;

            }else if(y<1){
                game.scene.piste.action=#left;
                game.scene.piste.stepY-=y*10;
            }
i defined the #left and #right property like this:
Code:
// move on horizontal axis to the right
             if (this.action == #right)
            {
                // do not move out of the screen
                if (this.viewY > System.height - this.frameHeight) {
                    this.action = #wait;
                } else
                    this.viewY += this.stepY;
            }

            // move on horizontal axis to the left
             if (this.action == #left)
            {
                // do not move out of the screen
                if (this.viewY > System.height - this.frameHeight) {
                    this.action = #wait;
                } else
                    this.viewY -= this.stepY;
            }
anyway its not doing much and giving me strange errors like "wrong type - undefined" for this line
Code:
if (this.viewY > System.height - this.frameHeight)
i know i should be asking this in the official moscrif forums but they seem to be pretty dead. no one ever received an answer there :-/
ive been struggling with this problem for a few weeks now. i know its probably just me thinking too complicated (i suck at programming but i have to finish this project).

maybe anyone here is kind enough to help or make other suggestions as to how to make my slope respond to the sensor input. BTW if anyone was wondering what "piste" means, its the german word for slope

sorry for stealing your time!!

many thanks in advance
yours desperately
tchintchie