> I am looking forward to seeing how this could be reduced to one line
of code. ;-)

I'll leave that up to Colin. He's the one-line champion.

Your code is very clean, and you obviously know what you're doing. As to
assigning the member to the sprite, I don't see how you could do that
more efficiently if you're creating animations on the fly. If you're
using film loops, I've got a nifty little script that will tell you when
the film loop is done:

property pLoopSpriteNum
property pMyOwner
property pMyCallback
property pSkipAnim

on new me, loopSprite, myOwner, myCallBack
  pLoopSpriteNum = loopSprite
  pMyOwner = myOwner
  pMyCallBack = myCallBack
  pSkipAnim = FALSE
  add the actorList, me
  return me
end

on stepFrame me
  tell sprite(pLoopSpriteNum)
    atEndOfLoop = (the frame = the lastFrame)
  end tell
  
  if atEndOfLoop  or pSkipAnim then
    call (pMyCallBack, pMyOwner)
  end if
end

on mouseUp me
  pSkipAnim = TRUE
end

I notice you don't have any handlers for frame events in your object. A
timeout object sends frame events--I'm not sure which ones, off the top
of my head, but if you put prepareFrame, enterFrame, and exitFrame
handlers in your object, it will speed things up.

Somebody help me here--it's been a while since I've used timeOut objects
for animations. How exactly do you handle frame events to keep them from
bogging down the timeOut?

Cordially,

Kerry Thompson


[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]

Reply via email to