Usage of CreateJS in Adobe Animate CC for adding image on Canvas


I would like to ask community how to implement addChild function in HTML5 Canvas type in Animate CC.
Here is a very simple scenario:
On the Canvas there are a MovieClip container (by name “imageContainer”) and button (by name “getContent_btn”). The code listed below doesn’t work?

Here is defined functions for image loading using CreateJS

function loadImage() {
  var preload = new createjs.LoadQueue();
  preload.addEventListener("fileload", handleFileComplete);

function handleFileComplete(event) {

And here is button function and listener

this.getContent_btn.addEventListener("click", fl_MouseClickHandler.bind(this));

function fl_MouseClickHandler()

Thanks in advance!


I found solution in other forum.


What was it?


Looks like the solution was from here:


Yes, prg9 is right.
I found solution in adobe forum but i will place it here:

var this_var = this;
var preload = new createjs.LoadQueue();

function loadImage() {
preload.addEventListener(“fileload”, handleFileComplete);
src: “someimage”,
id: ‘someid’

function handleFileComplete(event) {
var someid = preload.getResult(“someid”);
var bmp = new createjs.Bitmap(someid);

this.getContent_btn.addEventListener(“click”, fl_MouseClickHandler.bind(this));

function fl_MouseClickHandler() {

But there is one more detail here. I found that it is possible to use exportRoot instead of this_var.
So this_var.container.addChild(bmp); goes into exportRoot.container.addChild(bmp);

By the way
in respect to You Senocular