Force KeyPress

Hey folks! In one of my Flash movies, I need to “force”/fake a Enter or spacebar keypress without the user actually pressing the key. Does anyone know how I could do that?

Can I ask why? You don’t need Flash to actually pretend the user hit a key.

A possible workaround for the ActiveX updates :)…our users are given the code for hotlinking certain Flash files in blogs and on those blogs JavaScript is not allowed…so I need to “activate” the ActiveX from within Flash since all the workarounds out there use JavaScript in the code.

Perhaps work around the problem by using an intermediate function - somethingn like:

if (Key.isDown(Key.Enter)) {
    myFunction();
}


function myFunction():Void {
   // do stuff here
}

Then instead of ‘forcing a keypress’ you can just simulate it by calling myFunction()

Hopefully I haven’t missed the point - good luck.

Edit - sorry - I’ve just realised that I did miss the point! I thought this question was too easy! Sorry, mate. Good luck with the Active X anyway.

Thanks so much for your input though. I am really not liking Microsoft right now. I hope someone can help me find a workaround for this ActiveX stuff that doesn’t involve using JavaScipt :frowning: Thanks again!