Neither is "better" than the other since they do the same thing.
However, in a behavior, it is much easier to use "on exitFrame"
because it is sent to behaviors automatically. You don't have to do
anything except have an "on exitFrame" handler to receive the calls.
In a parent script, it's not the same. Parent scripts do not get
exitFrame messages. So, if you want to get a message every frame, you
must add the object created by the parent script to "the actorList".
Once it is in the actorlist, then it starts receiving calls to its
"on stepFrame" handler. You can also remove the object from the
actorlist to stop receiving these calls.
Back to behaviors ... If you only want to do something in an
exitframe handler under certain conditions, then you can do this:
property pCondition -- TRUE or FALSE
on beginSprite me
pCondition = FALSE -- or TRUE depending on what you want to do
...
end
on exitFrame me
if not(pCondition) then -- the condition is not true
return
end if
-- Do you exitFrame thing here
end
And somewhere you can set pCondition TRUE or FALSE
Irv
At 11:04 AM +0100 9/2/02, Lewis Fleming wrote:
>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?
>
>Thanks
>Lewis
>
--
Lingo / Director / Shockwave development for all occasions.
(Home-made Lingo cooked up fresh every day just for you.)
[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!]