Hide Adobe Animate objects by variable, from EaselJS

0

I'm starting with EaselJS, Animate and HTML5 and I can not find a way to hide a series of stage objects with names with sequential numbering: obj01, obj02, obj03 ...

for (hhh = 1; hhh < 10; hhh++) {
	
	this["obj0"+hhh].visible = false;
	
}

Could someone help me out?

    
asked by Jotajavi 17.05.2017 в 14:24
source

1 answer

0

Well, in the end it worked like this:

var root=this;
for (hhh = 1; hhh < 4; hhh++) { root["obj0" + hhh].on("pressmove", function (evt) { var p = this.parent.globalToLocal(evt.stageX, evt.stageY); evt.currentTarget.x = p.x; evt.currentTarget.y = p.y; }) root["obj0" + hhh].on("pressup", function (evt) { this.alpha = 1; }) }

    
answered by 23.05.2017 в 17:07