| Welcome to Brackenwood. We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| Now I Feel Really Dumb <(>_<)>; Controlling the timeline with keyboard | |
|---|---|
| Tweet Topic Started: Apr 17 2005, 02:03 PM (87 Views) | |
| KWarp | Apr 17 2005, 02:03 PM Post #1 |
![]()
Brackenwood Middleweight
|
I thought this would be really easy, but I suppose not.
Allright, what I wanna do is add some timeline control to the movie I made, but I figure buttons will both get in the way of the visual content and slow down the movie if I use alphas. So I figure, let's use the keyboard! The problem I've hit is that I have no idea how to properly code the Keyboard to respond to my buttons. Here's what I've written on the first frame of my timeline:
I hope it's close. Any help? Also, how would I check if the movie is playing or not? Is it something as simple as:
? |
![]() |
|
| ItsaMystery | Apr 18 2005, 11:06 AM Post #2 |
|
Brackenwood Lightweight
|
You're on the right track
First, make sure your movie is in a movie clip (you can give it an instance name of 'movie'). Then, off side of the stage, make another movie clip (just a little ball, or something of the sort; it doesn't really matter what it is, as long as it's a movie clip). Title this 'controller'. Now, add this code into the controller movie clip:
Fairly simple, and should work for what you're trying to do! Hope that helps
|
![]() |
|
| ItsaMystery | Apr 18 2005, 11:14 AM Post #3 |
|
Brackenwood Lightweight
|
While I'm at it... Create a dynamic text box anywhere on the stage, and give it a var name of 'input'. Now, plug in this new code to the controller movie clip:
If the movie is playing, the the text box will read 'true'. If it's stopped, it will read 'false'. Good luck to you! :lol:
|
![]() |
|
| KWarp | Apr 19 2005, 07:41 PM Post #4 |
![]()
Brackenwood Middleweight
|
Now that's quite useful. Although I really wanted the Spacebar to toggle the stop and play function. As in, push once: it stops, push again: it plays. Also, if I wanted my movie to respond to any of the keys other than the constants like SPACE, DELETEKEY, etc, do I just need to type the actual key in the code?
Will Flash recognize that as the "5" key on the keyboard, or does it need to be in quotes or something? |
![]() |
|
| mikepol | Apr 21 2005, 09:56 AM Post #5 |
![]()
Brackenwood Newbie
|
you need to look up the keycodes for each key on the keyboard... in the case of the number 5 the keycode is 101 |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Actionscript · Next Topic » |








12:31 AM Jul 12