Be a Supporter!

Code for Spacebar

  • 427 Views
  • 4 Replies
New Topic Respond to this Topic
Farza
Farza
  • Member since: Sep. 17, 2009
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Code for Spacebar 2009-12-12 08:20:20 Reply

*All this in AS2*

Whats the code if i want to start an animation by pressing the spacebar?
for example
It shows a start screen and says *PRESS SPACEBAR TO START*
Get it?
I only want it to play. Not Play/Pause


I am a FAB

BBS Signature
Nayhan
Nayhan
  • Member since: Sep. 8, 2006
  • Offline.
Forum Stats
Member
Level 23
Blank Slate
Response to Code for Spacebar 2009-12-12 08:31:03 Reply

If space is pushed, movie plays...

if (Key.isDown(Key.SPACE)) {
     _root.play();
}

don't be late | Collab101 | Australian Users List | Nayhan's actionScript examples > click

Farza
Farza
  • Member since: Sep. 17, 2009
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Code for Spacebar 2009-12-12 08:35:37 Reply

Where do I post this code


I am a FAB

BBS Signature
4urentertainment
4urentertainment
  • Member since: Aug. 1, 2008
  • Offline.
Forum Stats
Moderator
Level 13
Game Developer
Response to Code for Spacebar 2009-12-12 08:57:59 Reply

At 12/12/09 08:35 AM, windowskiller wrote: Where do I post this code

In an enterFrame event.

daytonj
daytonj
  • Member since: Jan. 9, 2008
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to Code for Spacebar 2009-12-12 12:43:17 Reply

or put it

<code/>
stop();
if (key.isDown(key.ENTER)){
play();
}
<code\>

on the


My KKK name is Imperial Warrior