At 18:14 +0100 04/25/2002, Kevin McCarthy wrote:

>Is it possible to actually have frame by control over the playhead, so
>if I said,
eypressed X then
>
>Go to the frame+1
>
>Else
>
>If keyup then

>Stop at current frame

Sure, you could go the frame.

   if keyPressed ( "x" ) then
     go the frame + 1
   else
     go the frame
   end if

You might prefer setting the keyDownScript though, because 
keyPressed, once it gets a value, keeps that value until another key 
is pressed.

What you might want to do is span this behavior across however many 
frames of score you want to have animating under key control:

   PROPERTY pyState

   on beginSprite me
     pyState = #hold
   END beginSprite

   on exitFrame me
     if pyState = #hold then
       go the frame
     else
       go the frame + 1
     end if
   END exitFrame

   on keyDown me
     if the key = "a" then
       pyState = #proceed
     else
       pyState = #hold
     end if
   END keyDown

   on keyUp me
     pyState = #hold
   END keyUp

Note that there's a beginSprite here; that's not a typo. The score 
script channel is more or less a sprite channel for hte purposes of 
making behaviors. You cna put the above code into the score script 
and span it across as many frames as you want.

The idea is that as long as the user has pressed the 'a' key and kept 
it pressed, the playhead will move to the next frame in the series. 
As soon as the key is released or any other key is pressed, 
everything holds on the frame in which the key event was detected.

-- 

              Warren Ockrassa | http://www.nightwares.com/
  Director help | Free files | Sample chapters | Freelance | Consulting
        Author | Director 8.5 Shockwave Studio: A Beginner's Guide
                    Published by Osborne/McGraw-Hill
          http://www.osborne.com/indexes/beginners_guides.shtml
[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