At 6:46 PM +0000 2/6/01, nik max wrote:
>dear all,
>
>how can i quickly and relyably check that all flash sprites have 
>stopped playing on the stage (necessary before i can move on to the 
>next frame)?
>
>i am using 'sprite(whichFlashSprite).playing',
>but do i put this in a loop or just check at very small intervals. 
>what about sending a messge from the respective flash moveis to 
>director? 'along the lines of "ok i am finished now"?
>

Not sure if you are looking for a dynamic solution (that is, figure 
out which are the flash sprites automatically) or not.  But if you 
know which ones are flash sprites, you could do something like this 
in a frame script (untested):

property plchFlash  -- property which is a list of channels of Flash sprites

on beginSprite me
   plchFlash = [2, 5, 7, 10]  -- Which ever are flash sprites
end

on exitFrame me  -- here's where to do the test
   nChannels = count(plchFlash)
   repeat with i = nChannels down to 1  -- go in reverse order, 
because we will be deleting
      ch = plchFlash[i]
      if not(sprite(ch).playing) then -- this one is done, eliminate it
         deleteAt(plchFlash, i)
       end if
    end repeat
    if plchFlash = [] then
      go to the frame + 1  -- we done
    else
      go to the frame  -- there are still one or more playing
    end if
end

There is probably is a simple way to run through all the sprites and 
figure out which are flash, something like:

on beginSprite me
   plchFlash = []
   repeat with ch = 1 to the lastChannel
      if sprite(ch).type = #flash then -- I don't know what the right 
thing is here
         append(plchFlash, ch)
      end if
   end repeat
end

Good luck

Irv
-- 
Lingo / Director / Shockwave development for all occasions.

        (Over two millions lines of Lingo code served!)

[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