# What have I done wrong?

**URL:** <https://forum.kirupa.com/t/what-have-i-done-wrong/330982>\
**Category:** flash\
**Created:** [April 20, 2013, 3:08pm UTC](https://forum.kirupa.com/t/what-have-i-done-wrong/330982 "2013-04-20T15:08:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gurre](https://avatars.discourse-cdn.com/v4/letter/g/3da27b/32.png) [@gurre](https://forum.kirupa.com/u/gurre)\
**Post date:** [April 20, 2013, 3:08pm UTC](https://forum.kirupa.com/t/what-have-i-done-wrong/330982/1 "2013-04-20T15:08:18Z")

</div>

[COLOR=#000000][FONT=verdana]Hello,[/FONT][/COLOR]

[COLOR=#000000][FONT=verdana]I’m making a car move. First I imported an image to my document, then I made it in to a symbol. Then I right clicked on the layer and in actions I have this:

```auto
[/FONT][/COLOR]var speed:Number = new Number (0);

onClipEvent (enterFrame);
	{
    if (Key.isDown (Key.UP)) {
        speed += 1.5;
    }
	speed = speed * 0.98;
	}

	if (Key.isDown (Key.DOWN)) 
	{
    speed -= 0.8;
	}
	
	if (Key.isDown (Key.RIGHT)) 
	{
    _rotation += 8;
	}
	
	if (Key.isDown (Key.LEFT)) 
	{
    _rotation -= 8;
	}
	
_x += Math.sin (_rotation * Math.PI / 180) * speed;
_y += Math.cos (_rotation * Math.PI / 180) * -speed;

	if (Math.abs (speed) > 20)
	{
    speed = 20;
	}
	
	if (speed < -10)
	{
    speed = -10;

	}[COLOR=#000000][FONT=verdana]

```

[/FONT][/COLOR][COLOR=#000000][FONT=verdana]But I get a lot of errors saying “Access of undefined property Key”, Access of undefined property enterFrame", “Call to a possibly undefined method onClipEvent”, “Access of undefined property \_rotation”, Access of undefined property \_x" and “Access of undefined property \_y”. [/FONT][/COLOR]

[COLOR=#000000][FONT=verdana]Anyone know what I have done wrong and could help me solve the errors?[/FONT][/COLOR]

[COLOR=#000000][FONT=verdana]Thanks in advance![/FONT][/COLOR]
