Skip to main content
Participant
August 31, 2021
Answered

JavaScript. How to spawn movie clip on a specific spawnpoint?

  • August 31, 2021
  • 1 reply
  • 157 views

Is this possible in this program? Just I can't find something like object spawning in documentation

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

    Hi.

     

    In the HTML5 Canvas document, go to the Library, select the desired symbol and give it a linkage name.

     

    Then add this code at say frame 0 of the main timeline:

    var player = new lib.Player(); // Player is the linkage name in the Library
    player.x = 275;
    player.y = 200;
    this.addChild(player);

     

    I hope this helps.

     

    Regards,

    JC

    1 reply

    JoãoCésar17023019
    Community Expert
    JoãoCésar17023019Community ExpertCorrect answer
    Community Expert
    August 31, 2021

    Hi.

     

    In the HTML5 Canvas document, go to the Library, select the desired symbol and give it a linkage name.

     

    Then add this code at say frame 0 of the main timeline:

    var player = new lib.Player(); // Player is the linkage name in the Library
    player.x = 275;
    player.y = 200;
    this.addChild(player);

     

    I hope this helps.

     

    Regards,

    JC