RE: [Flashcoders] listing children?

2006-11-28 Thread Steven Sacks | BLITZ
If you're looking for something a bit more advanced, check out the
Composite design pattern.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] listing children?

2006-11-23 Thread Julien Vignali

A quick way:

// this = the parent MC
for (var child:String in this){
 if (child instanceof MovieClip) {
   // do your children mc manipulations...
 }
}

2006/11/23, Wendy Richardson [EMAIL PROTECTED]:


If I have a mc with some mc's attached, is there a quick way to
list/access/manipulate the attached mc's without using their explicit
names?  Some kind of  children thingy?

Thanks
Wendy
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com





--
Julien Vignali
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] listing children?

2006-11-23 Thread Julien Vignali

Another way (maybe a smarter and cleaner one):

create an array of children and fill it when you attach the children mc.
var children:Array = [];
function addChild(link:String, name:String, depth:Number){
 var child:MovieClip = this.attachMovie(link, name, depth);
 children.push(child);
}

and then later in your code:

for (var i:Number = 0; i  children.length; i) {
 var child:MovieClip = children[i];
 // do your child mc manipulations...
}

Hope it helps ;-)
Regards

2006/11/23, Julien Vignali [EMAIL PROTECTED]:


A quick way:

// this = the parent MC
for (var child:String in this){
  if (child instanceof MovieClip) {
// do your children mc manipulations...
  }
}

2006/11/23, Wendy Richardson  [EMAIL PROTECTED]:

 If I have a mc with some mc's attached, is there a quick way to
 list/access/manipulate the attached mc's without using their explicit
 names?  Some kind of  children thingy?

 Thanks
 Wendy
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com




--
Julien Vignali





--
Julien Vignali
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] listing children?

2006-11-23 Thread el oskitar

try

for (var i in my_mc){
  if (typeof(my_mc[i]) == movieclip)){
  my_mc[i].foo();
  }
}



2006/11/23, Wendy Richardson [EMAIL PROTECTED]:


If I have a mc with some mc's attached, is there a quick way to
list/access/manipulate the attached mc's without using their explicit
names?  Some kind of  children thingy?

Thanks
Wendy
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com