  | |  | Is the BroadcasterMX._listeners Array faster? | Is the BroadcasterMX._listeners Array faster?
2004-02-23 - By Warren, Ashley
Back I have an AS 2.0 class which extends BroadcasterMX and as I create objects I add them to my BroadcasterMX _listeners array. Is it really faster for me to broadcastMessage and call a particular object 's method or would it be just as fast for me to create my own array and just for loop through them and call them that way?
EX : >
// Loop to create all of my objects starts here
for (var i = 0; i < 25; i++)
{
var listeningObject:Object = new Object ();
//
myBroadcasterClass.myListeners.push (listeningObject);
}
// Custom broadcast method
public function heyYa ():Void
{
for (var i = 0; i < myListeners.length; i++)
{
myListeners[i].objectMethod();
}
}
// Or something like that
Thanks in advance.
Ash
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Supported by Fig Leaf Software
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Be sure to check the archives and the wiki:
http://chattyfig.figleaf.com/
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:105015
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)
|
|
 |