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.