# Making A Game But I need a little help with action script

**URL:** https://forum.kirupa.com/t/making-a-game-but-i-need-a-little-help-with-action-script/27540
**Category:** flash
**Created:** [August 3, 2003, 9:12pm UTC](https://forum.kirupa.com/t/making-a-game-but-i-need-a-little-help-with-action-script/27540 "2003-08-03T21:12:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ckyfan](https://avatars.discourse-cdn.com/v4/letter/c/7993a0/32.png) [@ckyfan](https://forum.kirupa.com/u/ckyfan)
#### Post date: [August 3, 2003, 9:12pm UTC](https://forum.kirupa.com/t/making-a-game-but-i-need-a-little-help-with-action-script/27540/1 "2003-08-03T21:12:28Z")

</div>

Im making a game called escape from alcatraz and I need some of the actionscript but dont know what that certain line of action script is needed to do what I want to do I want a guy to walk up to the door then you have to punch in the code with the mouse on the keypad on the door to get to the other side. Here is a example that I found go to [www.stickdeath.com](http://www.stickdeath.com) then go to shocked shi\* on the left side of the menu then go to the bottomof that page to find a game called escape from greenvile when you start off theres a paper on ground click and hold it then tells you the code then you go up the alley way to the door where the code is needed to get through the door could any body please tell me what line or whatever is need in action script to do that in my game any help is really appreciated thanks for your time.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 4, 2003, 12:27am UTC](https://forum.kirupa.com/t/making-a-game-but-i-need-a-little-help-with-action-script/27540/2 "2003-08-04T00:27:06Z")

</div>

I had this problem once, this is my solution:

for simplicity, we will say the code has 3 numbers. and that code will be 486.

your set up will look something like this: (attached file)

on the very first frame of animation you have this:

```auto
global.keycode = 0

```

on each of the keypad buttons (1-9) you have this code:

[AS]on (release) {  
keycode\*=10;  
keycode+= (the value of the button ex. 5 or 9);  
}

```auto

then, on the "submit" button, you have:

```

on (release) {  
if (code == 486){  
(what ever the proceed animation is)  
output.text = “Accepted”;  
} else {  
output.text = “Denied”;  
code = 0;  
}  
}

```auto

and in the properties window for the output box (dynamic text box) named output, set the VAR: keycode.

that should pretty much do it. play with it a bit if it doesn't work.

now, if you will excuse me, I'm going to go get a drink.
```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 4, 2003, 2:03am UTC](https://forum.kirupa.com/t/making-a-game-but-i-need-a-little-help-with-action-script/27540/3 "2003-08-04T02:03:38Z")

</div>

oops, forgot the file!
