# Unable to increment \_x position

**URL:** <https://forum.kirupa.com/t/unable-to-increment--x-position/236395>\
**Category:** Uncategorized\
**Created:** [August 20, 2007, 3:51pm UTC](https://forum.kirupa.com/t/unable-to-increment--x-position/236395 "2007-08-20T15:51:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![camoconnell\_com](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/camoconnell_com/32/3655_2.png) [@camoconnell\_com](https://forum.kirupa.com/u/camoconnell_com)\
**Post date:** [August 20, 2007, 3:51pm UTC](https://forum.kirupa.com/t/unable-to-increment--x-position/236395/1 "2007-08-20T15:51:34Z")

</div>

hey there

i’m trying to move two MC’s left and right incremently with the following AS, it really seems like it should work…

[AS]  
// onEnterFrame capture the \_x position of theBackGround and cloudMC  
this.onEnterFrame= function (){  
var currentBgPosX = this.theBackGround.\_x;  
var currentCloudPosX = this.cloudMC.\_x;  
// then increment them and set new position variables  
var LHBgPosX = currentBgPosX - 66;  
var RHBgPosX = currentBgPosX + 66;  
var LHCloudPosX = currentCloudPosX - 33;  
var RHCloudPosX = currentCloudPosX + 33;  
}

// enter new position variables into functions  
function bgSlideLeft(){  
theBackGround.slideTo(LHBgPosX , 0, 1.5,“linear”);  
}

function bgSlideRight(){  
theBackGround.slideTo(RHBgPosX, 0, 1.5,“linear”);  
}

function cloudSlideLeft(){  
cloudMC.slideTo(LHCloudPosX, 0, 1.5,“linear”);  
}

function cloudSlideRight(){  
cloudMC.slideTo(RHCloudPosX, 0, 1.5,“linear”);  
}[/AS]

Thanks  
Cam
