# Need Help with Guitar Hero Type of Game

**URL:** <https://forum.kirupa.com/t/need-help-with-guitar-hero-type-of-game/303296>\
**Category:** programming\
**Created:** [January 18, 2010, 12:38pm UTC](https://forum.kirupa.com/t/need-help-with-guitar-hero-type-of-game/303296 "2010-01-18T12:38:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![redback93](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@redback93](https://forum.kirupa.com/u/redback93)\
**Post date:** [January 18, 2010, 12:38pm UTC](https://forum.kirupa.com/t/need-help-with-guitar-hero-type-of-game/303296/1 "2010-01-18T12:38:52Z")

</div>

Hello. I am trying to make a game like guitar hero. I am inside the Blue Button’s code and there are some errors. Here is the code:

```auto
package {
	import flash.display.MovieClip;
	import flash.ui.Keyboard;
	import flash.events.*;

	public class BlueButton extends MovieClip {
		var _root:Object = MovieClip(root);
		public function BlueButton() {
			this.addEventListener(Event.ADDED, enteredFrame);
			this.addEventListener(Event.ENTER_FRAME, enterFrameFunc);
		}
		public function enterFrameFunc(e:Event) {
			if(this._currentframe > 50){
				destroyButton();
			}
		}
		public function enteredFrame(e:Event) {
			stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressCheck);
		}
		public function keyPressCheck(e:KeyboardEvent) {
			trace("Hey");
		}
		public function destroyButton() {
			this.removeEventListener(Event.ENTER_FRAME, enterFrameFunc);
			stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressCheck);
			_root.removeChild(this);
			trace("You are OUTTA HERE!");
		}
	}
}

```

Problem 1: 1119: Access of possibly undefined property \_currentframe through a reference with static type BlueButton.

Problem 2: Can’t attach the Key\_Down event listener to the stage…

Please help 🙂 👁
