そうですね、フラッシュ プログラムには外部インターフェイスが必要です。このようなもの:
function keyCodeReceptor( code ){
switch ( code ) {
case 67:
// go to the next page
break;
// add any other keys you need to bind to "Alt+key" combination
default:
break;
}
}
flash.external.ExternalInterface.addCallback( 'doKey', null, keyCodeReceptor );
次に、オブジェクトを埋め込む HTML に次のようなものが必要になります。
(function(){
// Use the name or index of your embed here
var flash = document.embeds[0];
window.addEventListener( 'keydown', function( event ){
if( event.altKey && event.keyCode == 67 ){
event.preventDefault();
event.preventCapture();
event.preventBubble();
flash.doKey(event.keyCode);
}
});
})();
また、埋め込みのallowScriptAccess
属性が に設定されていることを確認して"always"
ください。
これはFirefox(最新、MacおよびWindows)でのみテストしたため、他のブラウザーで動作するかどうかはまったくわかりません。お役に立てれば!