• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Accessing movieClip.children expect one named movieClip

Explorer ,
Mar 21, 2022 Mar 21, 2022

Copy link to clipboard

Copied

I have been trying to access all children of a movie clip except one and can't find a way of doing it... has anybody discovered this. My example shows how I was trying to do this a click action works for all but need to exclude one named movieClip.

var root = this;  
  
root.fadeCountries = function(e)  
{  
    stage.off("drawstart", root.drawStart);  
  
    root.mapBtns.children.forEach(function(countries) 
    {   
          createjs.Tween.get(countries).to({alpha:0.5}, 500, createjs.Ease.quadOut);
    });

};
  
this.mapBtns.btn1.addEventListener("click", mapBtns1.bind(this));

function mapBtns1() 
{
	root.drawStart = stage.on("drawstart", root.fadeCountries, null, true);
}

 

Views

126

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 21, 2022 Mar 21, 2022

Copy link to clipboard

Copied

LATEST

Don't use forEach. Use a normal for loop to iterate over the children array, so you can include a check to skip over whatever members you don't want to process.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines