Here's the frame/sprite event order:

(I placed a single-frame script in the frame channel & placed the 
same script as a behavior on a single-width sprite in channel 1)

note: sprite -5 refers to the frame channel

-- (sprite -5) "beginSprite"
-- (sprite 1) "beginSprite"
-- (sprite 1) "prepareFrame"
-- (sprite -5) "prepareFrame"
-- (sprite 1) "enterFrame"
-- (sprite -5) "enterFrame"
-->> &the movie idles occur in here
-- (sprite 1) "exitFrame"
-- (sprite -5) "exitFrame"
-- (sprite -5) "endSprite"
-- (sprite 1) "endSprite"

Conclusions:
1. In a sprite's first frame, beginSprite occurs before prepareFrame 
which is before enterFrame.
2. In a sprite's last frame, exitFrame occurs before endSprite.
3a. sprite events occur last on the sprite channels
3b. frame events occur last on the frame channel

I believe you found out some of this below.

hth

-Buzz

At 6:11 PM +1000 3/31/02, you wrote:
>Andreas wrote:
>>I'm not sure of when to use the prepareFrame handler, but I can tell
>>you I use on beginSprite in both frame and sprite behaviors all the
>>time.
>
>Exactly what I will be doing from now on. :)
>I can visualise the 'on prepareFrame' handler listed in the 
>'Outdated Lingo' section of the next release of Director.
>Either that, or the 'Utterly Pointless, Just There To Annoy You 
>Lingo' section.
>
>
>Irv Kalb wrote:
>>As expected, the beginsprites from both the frame and script channels
>>execute once, but the prepareFrame scripts BOTH execute every frame
>>event.
>
>Ooops. Yes, you're right. I'm not sure how I came to that 
>conclusion. I must not have been awake at the time. :)
>Agreed though that 'on beginSprite' is the way to go for all situations. Joy!
>
>
>I did some more testing and discovered the following:
>
>In the frame script I put this:
>
>on exitFrame me
>   put "3"
>   go "there"
>end
>
>Attached to a sprite in the same channel I put this:
>
>on prepareFrame me
>   put "1"
>end
>
>on exitFrame me
>   put "2"
>   go the frame
>end
>
>
>The results:
>------------
>
>-- "1"
>-- "2"
>-- "1"
>-- "3"
>
>
>Strange indeed. The SPRITE script has precedence over the FRAME script.
>
>Although, if the 'on prepareFrame' handler is replaced with the most 
>trustworthy 'on beginSprite' handler, then the result is as expected:
>
>-- "1"
>-- "2"
>-- "3"
>
>
>
>Drekinn
>
>"It's not a bug, it's a random feature."
>
>
>[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!]

[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