animations inside while loops....

0 views
Skip to first unread message

Anthony Howe

unread,
Feb 19, 2010, 7:39:56 PM2/19/10
to Triba...@googlegroups.com
Hiya Folks,

A bit of saturday morning (in AU anyway!) animation fun for you....

What's goin on with this do you think?

Tryin to run a while loop that animates a little guy around the screen based on a set of positions (from/to) before closing. Like a 'join the dots' kind of sequence.

Works fine when there's only one trip to make, (i.e. a swap two items function), but on the multiple trips thing (full group shuffle), my little greyDude just disappears, then re-appears at the last position in the list at what I'm assuming is the end of the while loop. It seems as tho the while loop does not wait for RUN to finish before proceeding with it's tasks, so it basically just blasts through a bunch of run commands without waiting for each anim to finish?

How do I get it to wait for each trip to finish before proceeding in the while loop?

(BTW, to save you the suggestion, can't use targets instead of XY coords in Set Tweener as Set Tweener is relative pos only, and all targets are set to 0,0 inside their containers (and their containers containers!) due to use of 'duplicate' command in previous command sequence stuff).

PastedGraphic-1.png

Denis Williamson

unread,
Feb 19, 2010, 9:19:07 PM2/19/10
to triba...@googlegroups.com
Anthony,

I can't think of a solution to your problem yet, but to test whether
it is, as you suggest, the While loop not waiting for the Tween to
finish, you could step slowly through the code in the debugger and see
if each tween works when you allow enough time for it to do that.

Certainly, when you use a Run command with a video or sound file, then
the code that calls it does not stop while the movie runs (it could be
a long movie). If you want to wait with a movie element you have to
put in an "On finished" event and continue the code inside the movie
element (messy), but I don't know how one would do that with a Tween,
unless some well placed "refresh" commands could accomplish it.

Other thoughts revolve around whether the coords in your list move the
greyDude off the screen(?).
I'll keep thinking about it, though.

Denis

Anthony Howe

unread,
Feb 20, 2010, 9:58:35 AM2/20/10
to triba...@googlegroups.com
Thanks Denis.

I'm reasonably certain it's not going off screen at all.

The only theory I have so far (untested) is to put another while loop
inside the first while loop that waits for a message (perhaps a true/
false of 'running' attribute) or a variable set by an 'onFinished'
event (your example) triggered by the animating element each time it
finishes. Sounds gnarly but may work.

....that way any commands after the run command would be restrained
until the second while loop finishes?

I'm just thinking out loud on the iPhone, otherwise I could have
tested all that by now!

...the whole objective is to position a dynamically loading qty of
points on screen, for an animation to tween itself around. I guess, as
usual there's about 50 ways to do it- but my sense is while loops and
lists are they way to go here...

Anthony,

Denis

--
You received this message because you are subscribed to the Google Groups "iShell discussion". The place to learn and talk about tribalmedia's iShell. Please visit us a http://www.tribalmedia.com.

To post to this group, send email to Triba...@googlegroups.com
To unsubscribe from this group, send email to TribalForum...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/TribalForum?hl=en

Reply all
Reply to author
Forward
0 new messages