These are mcs that are created on the stage - not in code.... How would I refer 
to them in this:

var myMovieClips:Array = [mc1, mc2, mc3, mc4];

??

________________________________________
From: [email protected] 
[[email protected]] On Behalf Of Merrill, Jason 
[[email protected]]
Sent: Wednesday, June 30, 2010 10:45 AM
To: Flash Coders List
Subject: RE: [Flashcoders] Adding listener

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
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to