# Is this code correct?

**URL:** <https://forum.kirupa.com/t/is-this-code-correct/103103>\
**Category:** Uncategorized\
**Created:** [March 2, 2004, 12:55am UTC](https://forum.kirupa.com/t/is-this-code-correct/103103 "2004-03-02T00:55:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dru\_nasty](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@dru\_nasty](https://forum.kirupa.com/u/dru_nasty)\
**Post date:** [March 2, 2004, 12:55am UTC](https://forum.kirupa.com/t/is-this-code-correct/103103/1 "2004-03-02T00:55:39Z")

</div>

\_global.mainTimeline = this;  
function moveball () {  
mainTimeline.ball.\_x += 10;  
mainTimeline.ball.\_y += 10;  
}  
moveBall();

This is an exercise im doing from Colin Moocks’ “Actionscript For Flash MX” book.  
I put the code on frame 1 layer 1 of a movie. Then added a movie clip of a ball to the stage with the instance name “ball”.  
The code should move the ball but when I export it, nothing happens.  
Any reasons why? I added the code like it said in the book.  
thanks
