# (fmx) delay problem

**URL:** <https://forum.kirupa.com/t/fmx-delay-problem/26180>\
**Category:** flash\
**Created:** [July 20, 2003, 6:22pm UTC](https://forum.kirupa.com/t/fmx-delay-problem/26180 "2003-07-20T18:22:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JosipRadan](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@JosipRadan](https://forum.kirupa.com/u/JosipRadan)\
**Post date:** [July 20, 2003, 6:22pm UTC](https://forum.kirupa.com/t/fmx-delay-problem/26180/1 "2003-07-20T18:22:12Z")

</div>

I have a piece of code that won’t work, if you know please explain why:  
(everything else works)

function cw() {  
i=0;  
while (i \< 46) { //45 degree rotation  
x=getTimer();  
while (getTimer()\< x+10) {} //10ms delay  
menu.\_rotation += i;  
choice.\_rotation += i;  
i++;  
}}

I am calling this function from a button (onPress), the final result is  
as it should be but i don’t have the motion effect (delay), it just skips those 44 degrees and goes straight to 45 WITH the delay of 450ms??? -WHY?  
(i’ve tried to do that straight from the button, without a function,  
because i thought that the function might be working properly -it returns the final result -\> 45deg with the 450ms delay BUT it doesn’t do anything when i put it on a button, it seems to me that menu and choice aren’t accessible, but i don’t understand why)  
THX

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 20, 2003, 9:00pm UTC](https://forum.kirupa.com/t/fmx-delay-problem/26180/2 "2003-07-20T21:00:00Z")

</div>

remove the spaces between while and (.
