イベント配信クラス×3
イベント配信クラス3つを書き方を並べてみた。特に意味はないです。
前に addEventListener と addListener を間違えてツマづいたからメモ。
mx.events.EventDispatcher クラスでの書き方import mx.events.EventDispatcher;
var obj:Object = new Object(); // イベント配信オブジェクト作成
EventDispatcher.initialize(obj); // 実装
var listenerObj:Object = new Object(); // リスナーオブジェクト作成
listenerObj.onEvent = function(ev) {
trace(ev.target); // [object Object]
trace(ev.type); // onEvent
trace(ev.param); // メッセージ
};
obj.addEventListener("onEvent", listenerObj); // 登録
obj.dispatchEvent({type:"onEvent", param:"メッセージ"}); // 配信
obj.removeEventListener("onEvent", listenerObj); // 解除
mx.transitions.BroadcasterMX クラスでの書き方import mx.transitions.BroadcasterMX;
var obj:Object = new Object(); // イベント配信オブジェクト作成
BroadcasterMX.initialize(obj); // 実装
var listenerObj:Object = new Object(); // リスナーオブジェクト作成
listenerObj.onEvent = function(ev) {
trace(ev.target); // [object Object]
trace(ev.type); // onEvent
trace(ev.param); // メッセージ
};
obj.addListener(listenerObj); // 登録
obj.broadcastMessage("onEvent", {target:obj, type:"onEvent", param:"メッセージ"}); // 配信
obj.removeListener(listenerObj); // 解除
AsBroadcaster クラスでの書き方var obj:Object = new Object(); // イベント配信オブジェクト作成
AsBroadcaster.initialize(obj); // 実装
var listenerObj:Object = new Object(); // リスナーオブジェクト作成
listenerObj.onEvent = function(ev) {
trace(ev.target); // [object Object]
trace(ev.type); // onEvent
trace(ev.param); // メッセージ
};
obj.addListener(listenerObj); // 登録
obj.broadcastMessage("onEvent", {target:obj, type:"onEvent", param:"メッセージ"}); // 配信
obj.removeListener(listenerObj); // 解除
BroadcasterMX と AsBroadcaster の違いは何?
前に addEventListener と addListener を間違えてツマづいたからメモ。
mx.events.EventDispatcher クラスでの書き方
var obj:Object = new Object(); // イベント配信オブジェクト作成
EventDispatcher.initialize(obj); // 実装
var listenerObj:Object = new Object(); // リスナーオブジェクト作成
listenerObj.onEvent = function(ev) {
trace(ev.target); // [object Object]
trace(ev.type); // onEvent
trace(ev.param); // メッセージ
};
obj.addEventListener("onEvent", listenerObj); // 登録
obj.dispatchEvent({type:"onEvent", param:"メッセージ"}); // 配信
obj.removeEventListener("onEvent", listenerObj); // 解除
mx.transitions.BroadcasterMX クラスでの書き方
var obj:Object = new Object(); // イベント配信オブジェクト作成
BroadcasterMX.initialize(obj); // 実装
var listenerObj:Object = new Object(); // リスナーオブジェクト作成
listenerObj.onEvent = function(ev) {
trace(ev.target); // [object Object]
trace(ev.type); // onEvent
trace(ev.param); // メッセージ
};
obj.addListener(listenerObj); // 登録
obj.broadcastMessage("onEvent", {target:obj, type:"onEvent", param:"メッセージ"}); // 配信
obj.removeListener(listenerObj); // 解除
AsBroadcaster クラスでの書き方
AsBroadcaster.initialize(obj); // 実装
var listenerObj:Object = new Object(); // リスナーオブジェクト作成
listenerObj.onEvent = function(ev) {
trace(ev.target); // [object Object]
trace(ev.type); // onEvent
trace(ev.param); // メッセージ
};
obj.addListener(listenerObj); // 登録
obj.broadcastMessage("onEvent", {target:obj, type:"onEvent", param:"メッセージ"}); // 配信
obj.removeListener(listenerObj); // 解除
BroadcasterMX と AsBroadcaster の違いは何?
投稿日 : 2005年10月25日 - yoshiweb - カテゴリ: ActionScript
コメント
投稿者 : http://tinyurl.com/yyqjmetf
2022年05月10日 11時01分07秒
投稿者 : tinyurl.com
I read this paragraph fully concerning the comparison of latest and previous
technologies, it's remarkable article.
technologies, it's remarkable article.
2022年05月12日 01時35分42秒
投稿者 : tinyurl.com
Very nice post. I just stumbled upon your weblog and wanted
to say that I've really enjoyed browsing your blog posts.
After all I'll be subscribing to your rss feed and I hope you write again very soon!
to say that I've really enjoyed browsing your blog posts.
After all I'll be subscribing to your rss feed and I hope you write again very soon!
2022年05月16日 19時17分50秒
投稿者 : http://t.co/n5EmDjrcrB
Keep this going please, great job!
2022年06月05日 13時42分46秒
投稿者 : tinyurl.com
Every weekend i used to go to see this web page, for the reason that i wish
for enjoyment, since this this website conations in fact
nice funny material too.
for enjoyment, since this this website conations in fact
nice funny material too.
2022年06月06日 11時33分08秒
投稿者 : tinyurl.com
I think the admin of this web site is really working hard for his web site, since here every material is
quality based information.
quality based information.
2022年06月06日 13時04分43秒
投稿者 : http://tinyurl.com/
This blog was... how do you say it? Relevant!!
Finally I have found something that helped me.
Appreciate it!
Finally I have found something that helped me.
Appreciate it!
2022年06月06日 16時34分44秒
投稿者 : tinyurl.com
I constantly emailed this webpage post page to all my friends, as if
like to read it after that my contacts will too.
like to read it after that my contacts will too.
2022年06月08日 06時36分16秒
投稿者 : tinyurl.com
Its like you learn my thoughts! You seem to know so much about this, such as you wrote the e-book
in it or something. I feel that you simply can do with a
few p.c. to power the message house a little bit, but other than that, that is excellent
blog. A great read. I will certainly be back.
in it or something. I feel that you simply can do with a
few p.c. to power the message house a little bit, but other than that, that is excellent
blog. A great read. I will certainly be back.
2022年06月08日 11時40分33秒
投稿者 : tinyurl.com
Hi colleagues, fastidious article and nice arguments commented at this
place, I am in fact enjoying by these.
place, I am in fact enjoying by these.
2022年06月09日 06時58分46秒
投稿者 : tinyurl.com
Good replies in return of this question with real arguments
and describing all about that.
and describing all about that.
2022年06月12日 06時56分44秒
投稿者 : tinyurl.com
I'll right away take hold of your rss feed as I can not
to find your e-mail subscription link or e-newsletter service.
Do you have any? Please let me realize so that I could subscribe.
Thanks.
to find your e-mail subscription link or e-newsletter service.
Do you have any? Please let me realize so that I could subscribe.
Thanks.
2022年06月14日 12時55分02秒
it