ラベル actionscript の投稿を表示しています。 すべての投稿を表示
ラベル actionscript の投稿を表示しています。 すべての投稿を表示

2007年8月31日金曜日

[director][actionscript] actionscriptからlingoへ通知する

・actionscript

I/F用オブジェクトクラスに通知用の関数を宣言。

var myInterface:Object = new Object();

myInterface.xNotify();

・lingo

swfファイルをステージに配置し、ビヘイビアスクリプト内で上記変数を取得する。

poInterface = me.getVariable(“myInterface”, false)自身の関数に対してsetCallback()でnotify()を結びつける。

me.setCallback(poInterface, "xNotify", #notify, me)

on notify(me, oInterface, arg)

put "actionscriptからの通知"

end notify

2007年8月30日木曜日

[director][actionscript] lingoからactionscriptへのアクセス

・actionscript

lingo側からアクセスするためのI/F用オブジェクトクラスを宣言する。
var myInterface:Object = new Object();

myInterface.test = function ( param:String ) {

trace(" function test() called. : " + param );

}

・lingo

swfファイルをステージに配置し、ビヘイビアスクリプト内で上記変数を取得する。
poInterface = me.getVariable("myInterface", false)

poInterface.test( "lingoからのメッセージ")

poInterface = VOID