LINGO in Mac Director6.5

I am hoping to have someone help me with lingo scripting.

What I have is a director movie containing two digital videos (Quicktime3) in which the first video starts playing while other animation is running at the same time and on my command(by a keypress) the second video will start to play in place of the first.

My problem is this: I have my lingo written in the frame script like this:

on exitframe
   go to the frame
    -- which will keep my first video looping
  if the keypressed = RETURN then go loop
    -- in using keypress, it will let me keep looping in
       the first video until I press a
       key function (RETURN) which then goes to my next
       marker(2nd video)

All I want to do is change the keypressed = RETURN to keypressed = SPACEBAR. Instead of pressing the return key to activate my second video, I would prefer to press the spacebar. I have tried KeyCode(49), I have tried the numToChar(32), I have tried KeyDown, keyUp, etc.

If anyone has any suggestions in how to write this lingo script, it would be greatly appreciated.
Thank you very much
Who is Participating?
RaydotConnect With a Mentor Commented:

Try: "if the keyPressed = SPACE then," and not SPACEBAR.

Also, you shouldn't have all of this code crammed in AFTER the "go to the frame" command.  What you could end up doing is creating a situation where this code is still executing even though the playback head has moved on.

Last, but not least, I'd suggest you look into using the "KeyDownScript."

Something like this:

on enterframe
   set the KEYDOWNSCRIPT = "movieControl"

on exitFrame
   go to the frame

Then in another movie script somewhere:

on movieControl
  if the key = SPACE then
     go frame "loop"   -- go to frame where second movie is
     set the keydownscript = EMPTY  -- e.g. condition has been fulfilled, we don't need this script any more
  end if
end movieControl

Good luck!  Let me know if I can help you with anything else...

The KeyCode shoudl work...are you sure the number is 49 though?! according to a book I have that is the wrong number...I might be mistaken, but I would double check it if I were you.
juliuscrassusAuthor Commented:
The keyCode is in fact, 49. Please check your book, again I am working on the Mac, maybe for Windows it is different.
Definitely keyCode = 49
Thanks anyways
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to and use offer code ‘EXPERTS’ to get 10% off your first purchase.

juliuscrassusAuthor Commented:

I have found an easier solution while waiting for your answer.Thanks for all your help. Just to let you know: "If the keyPressed = SPACE" doesn't work either.Thanks!
I actually tested "if the keyPressed = SPACE" before I sent it to you.  You found another solution, you's not really easy handling Digital Video in Director.  I know what the manuals say, but I've been working with this application for 3 years, and it's never just something simple...

Have you ever checked out the Direct-L or Lingo-L mailing lists?  They're great resources for people with director questions...

juliuscrassusAuthor Commented:
How do I get in contact with these mailing lists? Thanks for this reference. Also, I really did try "if the keyPressed = SPACE" again and still doesn't work. But, "keyCode = 49" does work anyways. Thanks for all you help.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.