I believe that you are mistaken. At 10:09 PM +1100 3/30/02, you wrote: >Hi all, > >I've made some discoveries and am a little baffled. > >When looping in one frame: >-------------------------- >Using the 'on prepareFrame' handler in the frame script will execute >the commands within it every time the frame loops.
true - frame events happen on each frame that they are able to (as designed) >Using the 'on prepareFrame' handler in a sprite script will execute >the commands within it only once. nope - they happen on every frame of the sprite - that's one of the differences between it & beginSprite, which only fires in the first frame of the sprite. > >Using the 'on beginSprite' handler in a sprite script will execute >the commands within it only once. as it should >Using the 'on beginSprite' handler in the frame script will execute >the commands within it only once. as it should > > >Up until now I have been using the 'on prepareFrame' handler in >frame scripts, but to prevent it from re-executing the commands >within it every time the frame loops I have been setting a variable >to prevent this from happening more than once. > >Example >------- >global framePrepared > >on startMovie > framePrepared = 0 >end > >on prepareFrame me > if framePrepared = 0 then > framePrepared = 1 > <code to be executed> > <code to be executed> > <code to be executed> > end if >end > I hope these aren't within the same script member. the startMovie handler belongs in a movie script & the prepareFrame handler is usually in either a sprite behavior or a frame script (in the frame channel) I hope that you aren't coming to your conclusions based on how sprites behave in frame 1 behave because they have slightly different event firings in that frame compared to all other frames. > >What I'm getting at is what is the purpose of the 'on prepareFrame' >handler when the 'on beginSprite' handler can be used in a frame >script? the beginSprite for the frame script occurs after the beginsprite events for each of the 1-n sprites. >Is the 'on beginSprite' handler meant to be used in a frame script? it can, but it rarely is. >Or an 'on prepareFrame' handler to be used in a sprite script for that matter? not usually, since it fires on each frame. people use on enterFrame to do things at the beginning of each frame (see most of the behaviors in the Behavior Library) hth -Buzz > > >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!]
