Director: repeat loop problem
September 19th, 2005 by Carsten SchneiderI am updating a ten year old project so it runs on OS X.
To get optimal performance I kept everything inside one big repeat loop, with smaller repeat loops nested inside (e.g. while the mouseDown, etc.), instead of using go to the frame.
It seems though that now this is seen by the operating system as an unresponsive process, and therefore produces the ‘wait’ cursor.
You can test this with a very basic script:
on exitFrame me
repeat while 1=1
cursor 200
updateStage
end repeat
end
I’m not really up for stripping the code from all the repeat loops (i.e. rewriting everything), if you have a workaround let me know.


September 19th, 2005 at 8:18 pm
Yes, that can happen… user and system events are handled when the application cedes control. If the application doesn’t, then things pile up.
There were technotes on this topic, but they’ve been edited or replaced over the years… this one still contains some background, although it looks like the title was edited into something different (should have been “prevent excess mouseclicks from building up” or something, I forget):
http://www.macromedia.com/go/12490
jd/mm
September 25th, 2005 at 2:50 pm
fraid theres nothing you can do about it. in newer versions of director they fundamentally changed the way it works to be more multi-process friendly and faster. you’ll get major problems if you try to continue using your repeat loops in modern versions (it’ll screw up when you turn it into a projector even more).. i had to convert something a couple of months ago similarly… eek!
good luck!
September 28th, 2005 at 3:08 pm
Yeah, I completely reworked it. The main difficulty was deciphering my comments, all in rudimentary english, haha. The code now is even more confusing than before, but somehow it works. Thanks for the tips, John and Danny!