Loop problem help please lost much hair over this

I trying to do this.
When i mouseover a MovieClip i want to start a loop what will cause the movieClip to move along it’s X scale until a certian number is reached heres the code that doesn’t work.
please why not?

blue is the instance of my MovieClip

onClipEvent(load){
function hope() {
i = 0;
while(i<10) {
_root.blue._x = _root.blue._x + 5;
i = i + 1;
}
}
}
on(rollOver){
_root.blue.hope();
}

If you can help please do.

Is this the effect you are looking for:

[swf=http://www.macromotive.com/ebay/clip_move.swf width=500 height=100 wmode=transparent][/swf]

Here is the .fla and if you have any questions holla back:

<a href=http://www.macromotive.com/ebay/clip_move.fla>MOVE_CLIP FLASH SOURCE FILE</a>

Yeah. Thanks a lot.

 I also came up with another solution. I switched to using an "if" statment instead of a "while". Aamazing how the same effect can be done so many different ways. I still don't see why my original code doesn't work. Can you tell me why? I have one thought.

  It really does work but it does it too fast to be seen. I doesn't work execute frame by frame. The script executes all at once. 

 Agian thankyou very very much.

Darian

The reason your blue instance went fast is because it was using a ‘while’ loop, which is placed on a single frame and executes the loop until the condition is not met and this happens in the time of one frame which is well, not slow enough to see an animation and those types of loops are more for making animations using large amounts of data like arrays!