# Help Me I Am Going Crazy!

**URL:** <https://forum.kirupa.com/t/help-me-i-am-going-crazy/239036>\
**Category:** Uncategorized\
**Created:** [September 18, 2007, 9:03am UTC](https://forum.kirupa.com/t/help-me-i-am-going-crazy/239036 "2007-09-18T09:03:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chandings](https://avatars.discourse-cdn.com/v4/letter/c/c0e974/32.png) [@chandings](https://forum.kirupa.com/u/chandings)\
**Post date:** [September 18, 2007, 9:03am UTC](https://forum.kirupa.com/t/help-me-i-am-going-crazy/239036/1 "2007-09-18T09:03:50Z")

</div>

hey friends

i am trying to make a game similar to diner dash on flash

but there seems to be some problems.

in some code on the frames does not seem to work as expected.

the flash seems to be skippin some code.

#include “mc\_tween2.as”

var flip:Boolean=false;  
t1.onRelease=function(){  
trace(jenny.\_x+":"+jenny.\_y);  
moveTo(281,206);  
}

t2.onRelease=function(){  
moveTo(531,206);  
}

t3.onRelease=function(){  
moveTo(281,326);  
}

t4.onRelease=function(){  
moveTo(531,326);  
}

checkPos=function(posx:Number,posy:Number){  
if((posx==281&&posy==206)||(posx==531&&posy==206)||(posx==281&&posy==326)||(posx==531&&posy==326)){  
jenny.gotoAndStop(“jennyfrontstill”);  
}  
}

moveTo=function(posx:Number,posy:Number){  
var curx=Math.round(jenny.\_x);  
var cury=Math.round(jenny.\_y);  
posx=Math.round(posx);  
posy=Math.round(posy);  
trace(curx+":"+cury+";"+posx+":"+posy);  
if(curx==posx&&cury==posy){  
jenny.gotoAndStop(“jennyfrontstill”);  
trace(“a”);  
return;  
}

```
if(cury==posy){
    trace("b");
    jenny.gotoAndPlay("jennyside");
    if(curx&gt;posx){
        if(jenny._xscale&gt;0){
            trace(jenny._xscale);
            jenny._xscale*=-1;
        }
    }else if(jenny._xscale&lt;0)
        jenny._xscale*=-1;
    jenny.xSlideTo(posx,.7,"linear",0,function(){});
}else if(curx==406){
    trace("c");
    if(cury&gt;posy)
        jenny.gotoAndPlay("jennyback");
    else
        [U]**jenny.gotoAndPlay("jennyfront");//This code is skipping randomly**[/U]
    jenny.ySlideTo(posy,.7,"linear",0,function(){moveTo(posx,posy);});
}else{
    trace("d "+jenny._x+":"+curx);
    jenny.gotoAndPlay("jennyside");
    if(curx&gt;406){
        if(jenny._xscale&gt;0)
            jenny._xscale*=-1;
    }else if(jenny._xscale&lt;0)
        jenny._xscale*=-1;
        
    jenny.xSlideTo(406,.7,"linear",0,function(){moveTo(posx,posy);});
}
trace("end");

```

}

this.onEnterFrame=function(){  
checkPos(jenny.\_x,jenny.\_y);  
}

Please tell what i am doing wrong
