dtUser Posted November 5, 2010 Report Share Posted November 5, 2010 I have an movie clip I'm using as a button with an onRelease event handler in an inline function. movieclip.onRelease = function (){ //code that executes here } I would also want this code to execute if the user presses the Enter key. movieclip.onRelease = movieclip.onKeyDown = function (){ // code that executes here } Can anyone help fill in the missing code? Thanks Quote Link to comment Share on other sites More sharing options...
falkencreative Posted November 6, 2010 Report Share Posted November 6, 2010 As a warning, I know little about Flash... That said, this might help: TextField.prototype.onKeyDown = function () { if (Key.getCode() == Key.ENTER) { <----- I think this is the line you need // Enter was pressed. } }; From http://oreilly.com/pub/a/javascript/2003/05/20/colinmoock.html Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.