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!]

Reply via email to