Skip to main content
Participant
Aug 31, 2021 1:28 PM UTC
Answered

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

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

    This topic is closed to new replies. Start a new post to keep the conversation going.
    JoãoCésar17023019
    JoãoCésar17023019Correct answer
    Community Expert
    Aug 31, 2021 2:05 PM UTC

    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
    Aug 31, 2021 2:05 PM UTC

    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

    Translate