Easy:
var myMovieClips:Array = [mc1, mc2, mc3, mc4];
for each (var mc:MovieClip in myMovieClips)
{
mc.addEventListener(WhateverEvent.WHATEVER, onWhateverEvent);
}
Jason Merrill
Instructional Technology Architect
Bank of America Global Learning
Join the Bank of America Flash Platform Community and visit our
Instructional Technology Design Blog
(Note: these resources are only available for Bank of America
associates)
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Lehr,
Theodore
Sent: Wednesday, June 30, 2010 10:36 AM
To: Flash Coders List
Subject: [Flashcoders] Adding listener
Is it possible to add a listener to a multitude of mcs through a loop?
so instead of
mc1.addEventListener....
mc2.add....
mc3.add
...
...
..
maybe I have an array with each mc name and then loop through it to add
the event listeners?
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders