I am currently in the process of migrating a large flash application to canvas using Typescript, and I'm facing challenges when it comes to utilizing classes to extend library objects.
When working with a class library for buttons,
class BtnClass {
constructor(el: createjs.MovieClip) {
el.addEventListener("mouseover", MouseOverHandler.bind(el));
}
}
If I have an object placed on the stage in Animate CC, I can successfully use this class by adding actions in the frame for export,
Btn1 = new BtnClass(this.buttons.btn1_mc);
However, I am unable to make this work for dynamically placed library objects.
Attempting to extend my object with this class on a library object that is not placed on the Animate CC stage results in an error.
var libraryObject = new lib.btn2_mc();
var dynamicButton = createjs.extend(new BtnClass(libraryObject), libraryObject);
currentElement.addChild(dynamicButton);
Error: Argument of type 'BtnClass' is not assignable to parameter of type '() => any'. Type 'BtnClass' provides no match for the signature '(): any'.
Any insights or suggestions would be highly appreciated.