----- Original Message -----
From: "Colin Holgate" <[EMAIL PROTECTED]>
> >
> >With regards to a behaviour is it better to use "on exitFrame me" or "on
> >stepFrame me" when you want something to be constantly executed?
>
> It's partly a matter of style. In over seven years of full time
> Director programming, I've never once used stepframe.

Actually, if you are interested in performance the answer is *neither*. You
should use enterFrame, because this occurs immediately before Director's
idle cycle, so if you handlers take some time to complete, they will not
screw up the frame rate. I use stepFrame for performance reasons so that a
script doesn not need to be polled all the time, except when it is needed
(for instance, when dragging an object). However, I have recently decided
that for reasons of performance and usefulness, to avoid the actorList, and
create my own custom actorList instead. For instance, you can use the
following frame script:

global gSpecialActorList

on enterFrame me
  if( ListP( gSpecialActorList ) ) then
    call( #stepFrame, gSpecialActorList )
  end if
end

Then use gSpecialActorList in place of the actorList. Since the actorList
doesn't work in LDMs, and this solution is more efficient, it makes far more
sense than using the in-built actorList. You can also do things like add
some extra code for dynamically removing items from the list (you shouldn't
modify the actorList in a stepFrame handler). You could use multiple lists,
and turn them on and off as required. The possibilities are endless.

- Robert

[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