Be a Supporter!

Code help

  • 314 Views
  • 9 Replies
New Topic Respond to this Topic
Icandraw
Icandraw
  • Member since: Mar. 15, 2009
  • Offline.
Forum Stats
Member
Level 19
Animator
Code help 2009-12-12 11:43:33 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


GAME JAM 7

4urentertainment
4urentertainment
  • Member since: Aug. 1, 2008
  • Offline.
Forum Stats
Moderator
Level 13
Game Developer
Response to Code help 2009-12-12 11:54:33 Reply

Ehm

Icandraw
Icandraw
  • Member since: Mar. 15, 2009
  • Offline.
Forum Stats
Member
Level 19
Animator
Response to Code help 2009-12-12 11:56:24 Reply

At 12/12/09 11:54 AM, 4urentertainment wrote: Ehm

i know that u posted but it isnt WORKING


GAME JAM 7

4urentertainment
4urentertainment
  • Member since: Aug. 1, 2008
  • Offline.
Forum Stats
Moderator
Level 13
Game Developer
Response to Code help 2009-12-12 11:58:31 Reply

At 12/12/09 11:56 AM, Icandraw wrote:
At 12/12/09 11:54 AM, 4urentertainment wrote: Ehm
i know that u posted but it isnt WORKING

Post the code you have.

Icandraw
Icandraw
  • Member since: Mar. 15, 2009
  • Offline.
Forum Stats
Member
Level 19
Animator
Response to Code help 2009-12-12 11:59:18 Reply

At 12/12/09 11:58 AM, 4urentertainment wrote:
At 12/12/09 11:56 AM, Icandraw wrote:
At 12/12/09 11:54 AM, 4urentertainment wrote: Ehm
i know that u posted but it isnt WORKING
Post the code you have.

NOT WORKIIN !!!


GAME JAM 7

Icandraw
Icandraw
  • Member since: Mar. 15, 2009
  • Offline.
Forum Stats
Member
Level 19
Animator
Response to Code help 2009-12-12 12:04:43 Reply

At 12/12/09 11:58 AM, 4urentertainment wrote:
At 12/12/09 11:56 AM, Icandraw wrote:
At 12/12/09 11:54 AM, 4urentertainment wrote: Ehm
i know that u posted but it isnt WORKING
Post the code you have.

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


GAME JAM 7

Deadclever23
Deadclever23
  • Member since: Nov. 27, 2006
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Response to Code help 2009-12-12 12:06:39 Reply

if (Key.isDown(Key.SPACE)){
          _root.gotoAndPlay(2);
}

"To live is the rarest thing in the world. Most people exist, that is all."
- Oscar Wilde

BBS Signature
4urentertainment
4urentertainment
  • Member since: Aug. 1, 2008
  • Offline.
Forum Stats
Moderator
Level 13
Game Developer
Response to Code help 2009-12-12 12:20:28 Reply

If it still doesn't work, then you probably don't have it in an enterFrame event. In which case:

onEnterFrame = function(){
//code here
}
Icandraw
Icandraw
  • Member since: Mar. 15, 2009
  • Offline.
Forum Stats
Member
Level 19
Animator
Response to Code help 2009-12-12 12:20:55 Reply

At 12/12/09 12:06 PM, Deadclever23 wrote: if (Key.isDown(Key.SPACE)){
_root.gotoAndPlay(2);
}

it isnt workin ?


GAME JAM 7

daytonj
daytonj
  • Member since: Jan. 9, 2008
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to Code help 2009-12-12 13:50:20 Reply

on the frame of whatever says "PRESS SPACE TO START"
( Has to be AS2)
put this

stop();
if (key.isDown(key.SPACE)){
play();
}

My KKK name is Imperial Warrior