Hi Eric,

What's causing you the trouble is the timeout objects and the prepareFrame. 
Neither of which work properly in LDMs :-(

The timeoutList works just great in the LDM, the objects get created and added to 
the list BUT the objects in the list never seem to be triggered. Only the stage 
timeoutlist gets processed. So is there a work around. Yup, you need to add the 
timeout object to the stages timeoutlist. But if you do that then the child gets 
referenced while the scope in focused in the stage not in the LDM so that childs 
timeout handler would act at the stage level. To get around this set a flag and 
execute the event on an enterframe. This script should do the trick,


property pStartMem
property pFlag

on new me, aNum, aMem
  sprite(aNum).scriptInstanceList.add(me)
  pStartMem = sprite(me.spriteNum).member
  sprite(me.spriteNum).member = aMem
  tell the stage to x = timeout(string(me)).new(500, #aHandler, me)
end

on aHandler me, aTimeoutObj
  aTimeoutObj.forget()
  pFlag = 1
end

on enterFrame me
  if pFlag then
    sprite(me.spriteNum).member = pStartMem
    sprite(me.spriteNum).scriptInstanceList.deleteOne(me)
  end if
end

As far as prepareframe events they don't get triggered in an LDM when you 
specifically "go" to a frame so a command like "go the frame" renders 
prepareFrame events useless. BUT if the playback head enters the frame by 
simply advancing on its own then the prepareFrame gets called. Don't know why 
this happens but it does so to get prepareFrame called 19 out of 20 times span 
your sprite across 20 frames (say 1 to 20) then on frame 20 say "go to frame 1"

hth,

Rob


08/02/2003 8:20:18 PM, "Eric Greene" <[EMAIL PROTECTED]> wrote:

>This works as a movie by itself. The LDM works up to the child changing
>the sprites cast member. After that nothing happens. The sprite stays
>with its changed cast member. Is the timeout's response going somewhere
>else, or do I need to tell the LDM that time is passing by sending it a
>message?
>
>As a side note: Both problem behaviors do not need interaction with the
>mouse handlers after they start. The other behavior, the one I threw
>out, does not use timeOuts, but it does use prepareFrame, enterFrame,
>and ExitFrame. It does not work either as an LDM.
>
>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