P
ROTOTYPE
I'm Not Only The Prototype, I'm Also A Member.
home
▪
stats
▪
search
▪
linkback
▪
about
▪
FAQ
| user: guest,
login
,
register
ASBroadcaster
:
Extended ASBroadcaster message using
author:
ilya_cat
[+]
,
Submitted: 03.26.03 3a
// Now you can broadcast message with any optional parameters, passed inside of the object // by Ilya Cat (ilya_cat@mail.ru) ASBroadcaster.broadcastMessage = function(theEvent,obj) { var a = this._listeners; var i = a.length; while (--i) { a[i][theEvent](obj); } };
usage
// Here is a usage of new broadcastMessage // create the object with function a={hello:function(obj){trace(obj.text)}}; // create the broadcasting object broadcastobj={}; ASBroadcaster.initialize(broadcastobj); // adding [b]a[/b] as listener broadcastobj.addListener(a); // broadcasting message broadcastobj.broadcastMessage('hello',{text:'Hello, world!'});
msg
1
{
senocular
[+]
, posted: 03.26.03 5a•03.26.03 5a, top
[^]
}
broadcastMessage already does that :-\
example (not using this extended broadcastMessage):
obj = new Object() list = new Object() list.fun = function(arg){ trace(arg); } ASBroadcaster.initialize(obj) obj.addListener(list) obj.broadcastMessage("fun","passed argument"); // traces "passed argument"
msg
2
{
ilya_cat
[+]
, posted: 03.26.03 5a•-, top
[^]
}
Yes, I also found it now - it's an undocumented feature of undocumented feature of FlashMX ;-)
In any case, additional parameter is very useful.
Add Comment
[+]
›opyleft 2001-2013. Layer51 is: Jaime Prado.
@
buy wow gold
abendkleider online
cocktail dresses uk
woolrich outlet
clarisonic pro
long prom dresses