Mailing List
Home
Flash Pro
Extending Flash
Flash Macromedia Developer
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
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)