Interesting.
So it would stand to reason that if, instead of actually deleting the object
reference from the actorList, you simply set it to VOID, the line-up remains
intact, and the object in the list subsequent to any "voiding" would still
get it's stepFrame.
Let's test that theory, with one little change to the stepFrame handler in
the "actor" parent script:
on stepFrame me
put #step, pNum
(the actorList).setAt((the actorList).getOne(me), VOID)
end
-- Welcome to Director --
-- #step 1
-- #step 2
-- #step 3
-- #step 4
-- #step 5
-- #step 6
-- #step 7
-- #step 8
-- #step 9
-- #step 10
-- #step 11
-- #step 12
-- #step 13
-- #step 14
-- #step 15
-- #step 16
Yup. That does it. As long as Director doesn't object to seeing VOID
elements in its actorList, that seems to work.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Christopher Watson
Sr. Software Engineer
Lightspan, Inc.
http://www.lightspan.com/
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-----Original Message-----
From: Jakob Hede Madsen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 6:30 AM
To: [EMAIL PROTECTED]
Subject: Re: <lingo-l> stepFrame and enterFrame...
whats the real score?
At 13:39 +0000 01_04_26, Christian Wach wrote:
>Jakob Hede Madsen wrote:
>
>> You may be aware that when an object removes itself from
the
>> actorlist from within its stepFrame handler, then the
next object in
>> the actorList misses an event.
>
>yeesh!
>
>never heard of (or observed) this before...
>
>is this documented anywhere?
At least it has been discussed on Director lists before,
although
it's not one of the subjects that iterates every other week.
There is nothing spooky about it, it will happen anytime you
delete
items from a linear list during forward traversal, and the
general
trick is to traverse backwards.
>have you got a test movie for this?
The scripts below should illustrate:
----<movie script: (member 1 of castLib 1)>----
on startMovie
(the actorList).deleteAll()
repeat with i = 1 to 16
script("actor").new(i)
end repeat
end
----</movie script: (member 1 of castLib 1)>----
----<parent script: actor>----
property pNum
on new me, aNum
pNum = aNum
(the actorList).append(me)
end
on stepFrame me
put #step, pNum
(the actorList).deleteOne(me)
end
----</parent script: actor>----
----<score script: (member 3 of castLib 1)>----
on exitFrame me
go the frame
end
----</score script: (member 3 of castLib 1)>----
-- Welcome to Director --
-- #step 1
-- #step 3
-- #step 5
-- #step 7
-- #step 9
-- #step 11
-- #step 13
-- #step 15
-- #step 2
-- #step 6
-- #step 10
-- #step 14
-- #step 4
-- #step 12
-- #step 8
-- #step 16
Jakob
[To remove yourself from this list, or to change to digest
mode, go to
http://www.penworks.com/LUJ/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!]
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/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!]