Mootool の Swiff オブジェクトを使用して、Flash ムービーをロードし、それとの対話を開始しようとしています。ここの例に従っています:
http://mootools.net/blog/2008/02/12/whats-new-in-12-swiff/#more-63
私が知っているのは少し時代遅れです (events オプションは明らかに callBacks である必要があります) が、少なくとも開始する必要があります。それでも、私は物事を少し動かすことができません。JS エラーはありません。firebug は、少なくとも私のサーバーからロードされた SWF を示していますが、アラートはありません! 何が足りない?
アクションスクリプト:
//(ActionScript)
import flash.external.*;
function echoText(text) {
ExternalInterface.call('alert', "This message is from Flash: "+text);
}
ExternalInterface.addCallback( "echoText", this, echoText );
//Fires the 'onLoad' event within the Swiff object.
ExternalInterface.call(_root.onLoad);
私のJS:
<html>
<head>
<title>Terris test console</title>
</head>
<body>
<script type="text/javascript" src="mootools.js"></script>
<script type="text/javascript">
var obj;
window.addEvent( "domready", function() {
//(JavaScript)
obj = new Swiff('interface.swf', {
width: 1,
height: 1,
container: $('swiffContainer'),
callBacks: {
onLoad: function() {
alert("Flash is loaded!")
}
}
});
});
</script>
</body>
</html>
ここから Mootools 1.2.2 を使用していますhttp://mootools.net/download
何か案は?