# Some code probs

**URL:** <https://forum.kirupa.com/t/some-code-probs/193389>\
**Category:** Uncategorized\
**Created:** [July 13, 2006, 1:12am UTC](https://forum.kirupa.com/t/some-code-probs/193389 "2006-07-13T01:12:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajcates](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ajcates/32/2435_2.png) [@ajcates](https://forum.kirupa.com/u/ajcates)\
**Post date:** [July 13, 2006, 1:12am UTC](https://forum.kirupa.com/t/some-code-probs/193389/1 "2006-07-13T01:12:29Z")

</div>

it traces WTF when it is supposed 2, but it wont change the x vaule of thing\_mc, i want it to move to the right(it does this) then i want to have it move back, why i want to do this, well i really don’t know, but it should work

var thing:MovieClip = \_root.createEmptyMovieClip(“thing\_mc”, 1);  
var speed:Number = 5;  
thing\_mc.lineStyle(12);  
thing\_mc.\_x = 100;  
thing\_mc.\_y = 100;  
thing\_mc.lineTo(100, 0);  
thing\_mc.lineTo(100, 100);  
thing\_mc.lineTo(0, 100);  
thing\_mc.lineTo(0, 0);  
bob = “left”  
thing\_mc.onEnterFrame = function() {  
if (bob = “left”) {  
thing\_mc.\_x += speed;  
}  
if (thing\_mc.\_x == 100) {  
bob = “left”  
}  
if (thing\_mc.\_x == 200) {  
bob = “right”;  
}  
if (bob == “right”) {  
trace(“WTF??”)  
thing\_mc.\_x -= speed;  
}  
};
