Problems with attatching movie clips

I have created this little bit of coding for an idea I had,the only problem is is that it wont work.

//create object
keyListener = new Object();
//use onKeyDown function
keyListener.onKeyDown = function() {
//get the Ascii code
keypressed = Key.getAscii();

//if the letter press is 99 ("c")
if (keypressed == 99 or keypressed == 67)
this.attachMovie("movieclip");

};
//add listener to keys for this to work
Key.addListener(keyListener);

I want it so when a key on the keyboard(c in this example)is pressed it loads up a movie clip in place of the one on the page and plays it.I have tried many different things but still can not get it to work.

Does anyone have any ideas?

Cheers

Hmmm…I thought someone on here would have a better idea on this.

I’d wait a little longer than 14 minutes for a response. I don’t know how to do what you’re doing, but I know others here do. :slight_smile:

well here’s a partial start::
//on frame one, main timeline

Key.addListener(this);

this.onKeyDown = function() {
	if (Key.isDown(67)) {    
		loadMovieNum("something.swf", 1);
	}  
}

this will load an external swf by pressing “c”

with a little tweaking you could modify this to get different swf’s and from different key presses

Thanks a lot for the reply and you have helped me quite a bit =]

What if i wanted to attach a movieclip(that isnt in the main scene) from the library? How would I be able to do that?