Hey Robert,
I was thinking about your workaround for actorLists and stepFrame in
LDMs. The problem is not that the actorList doesn't work in LDMs but
rather that stepFrame doesn't get called in LDMs, just like prepareFrame
doesn't either. The interesting thing is that LDMs actually maintain an
actorlist separate from the stage.
Your approach of having a global custom actorList means that there will
be multiple calls to the objects in that list during one "event" cycle.
Lets say you have your script in the stage, an LDM on sprite 1 and an
LDM on sprite 2. And each of those puts something in the actor list.
During an "event" cycle, that is the time between movement of the
playback head, an enterFrame will be called for each of the 3 movies.
All those movies reference the same global list and will therefore send
out a stepFrame call 3 times even though you've just stepped into the
frame once. I'm not sure the effects this will have on performance but
you may be running handlers, like updating sprite positioning
unneccessarily.
Another approach may be to make use of the actor list but instead of
using the stepFrame handler create a custom stepFrame handler in your
scripts, something like
on enterFrame me
if not(the actorList = []) then
call(#customStep, the actorList)
end if
end
then each item in the actorlist will only be called once and if the
stepFrame issue gets fixed in some version you can simply do a global
replace of "customStep" with "stepFrame", remove the above code and
you're in business.
One issue with all this, there's always something, is if you have
multiple sprites referencing the same LDM cast member you don't really
have fully independant instances of the LDMs on the stage. Each sprite
referencing the same cast member can have independant parts, like their
sprite locations, colours etc but the share the same castlibraries and
also actorList. The only way to have truly unique instances of LDMs is
to have every sprite on stage reference a unique LDM cast member (those
cast members can all refer to the same external director movie).
I'll stop blathering there before this gets even more confusing :-)
Rob
Robert Tweed wrote:
> (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.
[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!]