Skip to main content
Known Participant
November 12, 2020
Answered

AddChild Using HTML5 Canvas In Animate 2020

  • November 12, 2020
  • 1 reply
  • 1344 views

I'm trying to add a movie clip from the library when I click a button on the stage. When I test the movie, I get no reponse when I click the button. Here's the code I'm using. The movie clip I'm trying to add is called "bluBox".

 

var fl_MyInstance = new lib.bluBox();

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

function fl_MouseClickHandler()
{

this.addChild(fl_MyInstance);
}

 

Thanks

    This topic has been closed for replies.
    Correct answer JoãoCésar17023019

    Hi.

     

    Is the linkage name of your symbol set to bluBlox in the Library?

     

    Please let us know.

     

    Regards,

    JC

    1 reply

    JoãoCésar17023019
    Community Expert
    JoãoCésar17023019Community ExpertCorrect answer
    Community Expert
    November 12, 2020

    Hi.

     

    Is the linkage name of your symbol set to bluBlox in the Library?

     

    Please let us know.

     

    Regards,

    JC

    mlb172Author
    Known Participant
    November 12, 2020

     

    Here's what I see in the library

    kglad
    Community Expert
    Community Expert
    November 12, 2020

    your code is failing because you have no linkage id assigned.  the symbol name isn't relevant when using the "new" constructor.

     

    do what @JoãoCésar17023019 suggested by double clicking in the linkage field of your bluBox library symbol and typing "bluBox" (without quotes).