Changing instance properties programmatically
Hi all,
I’m a lapsed js/as coder, dipping my toe back in with Adobe Animate.
I’ve put together a data viz scrounging bits of code from discussions around the web, but I’m banging my head trying to find what js library I’m drawing from, and how to access (address?) properties of AA library objects I’ve instantiated.
My code:
var _button = new lib._BlockRed();
// setting a means of identifying this on stage
stage["school" + num] = _button;
stage.addChildAt(_button,0);
// 'gotcha' being the elusive named instance
var gotcha = stage["school" + num];
gotcha.shape.graphics._fill.style = "#cc0000";
The above works to set a color, but I haven't been able to figure out how to change the size, set index or who knows what else I'll want to do to it. I settled on making a second keyframe to change the size and color, but I'd really like to find the api to access all shape.graphics properties.
createjs has a graphics.fill, but that's not it, right?
My first post here so let me know if I've breached protocol.
Too, if I'm going about programmatically editing instances the wrong way, a nudge in the right direction would be greatly appreciated.
Thanks,
Sean
