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);
}
Copy link to clipboard
Copied
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.