# Actionscript question

**URL:** <https://forum.kirupa.com/t/actionscript-question/664>\
**Category:** flash\
**Created:** [July 25, 2002, 3:17am UTC](https://forum.kirupa.com/t/actionscript-question/664 "2002-07-25T03:17:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![iceman](https://avatars.discourse-cdn.com/v4/letter/i/46a35a/32.png) [@iceman](https://forum.kirupa.com/u/iceman)\
**Post date:** [July 25, 2002, 3:17am UTC](https://forum.kirupa.com/t/actionscript-question/664/1 "2002-07-25T03:17:19Z")

</div>

Hey,

I was wondering if anyone could tell me how I could go about fixing this problem. My code is this:

Attached to MC:  
onClipEvent(load){  
startPos = this.\_x

Attached to frame:

text1.onKeyDown = function(){  
car.\_x=startPos

My problem is I want to have to have this code excecute when the backspace button is hit but I’m unsure about how to attach it to text1.onKeyDown = function(){?  
If anyone could help it would be great.

Thanks

Kyle

---

<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:** [July 25, 2002, 3:57am UTC](https://forum.kirupa.com/t/actionscript-question/664/2 "2002-07-25T03:57:09Z")

</div>

on(keyPress “\<Backspace\>”){  
car.\_x=startPos;  
}

or you can add a listener… depends on what you want to do.

---

<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:** [July 25, 2002, 4:39am UTC](https://forum.kirupa.com/t/actionscript-question/664/3 "2002-07-25T04:39:09Z")

</div>

This is the code that I want to use but its not working, so I obviously need an alternative.

text3.onKeyDown “\<Backspace\>” = function() {  
\_root.car.\_x = startPos;

I can’t figure out another way to do this, I would appreciate it if anyone could help me with this.

Thanks

Kyle

---

<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:** [July 25, 2002, 11:20am UTC](https://forum.kirupa.com/t/actionscript-question/664/4 "2002-07-25T11:20:09Z")

</div>

Ice, wasnt that an alternative?

btw… when I see the post the part that says BACKSPACE is missing…

```auto

onClipEvent(keyDown){
	
	if(Key.getcode()==75){
		pressed="you did it";
	}else{
		pressed="nope";
	}
}

```

this is, of course, attached to a movie clip.

---

<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:** [July 25, 2002, 1:21pm UTC](https://forum.kirupa.com/t/actionscript-question/664/5 "2002-07-25T13:21:22Z")

</div>

When I trace pressed, it says you did it when I hit K… But the principle is there. All you have to do is find the code for backspace.

pom :asian:

---

<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:** [July 25, 2002, 1:29pm UTC](https://forum.kirupa.com/t/actionscript-question/664/6 "2002-07-25T13:29:53Z")

</div>

The code’s 8.

pom :asian:
