Skip to main content
mathieAl
Participant
March 20, 2020
Answered

Stacking cards - z-index

  • March 20, 2020
  • 1 reply
  • 488 views
Working on an alphabet card game that's reads BTN's from an array but I can seem to get the selected button to go above the rest of the buttons on stage. 
here's the code I'm using
_this.setChildIndex( letter[i].BTN, _this.getNumChildren -1);

setChildIndex works it provides me with the BTN index.

but

getNumChildren - 1 doesn't do anythink am i missing something out?

 

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

    Hi.

     

    The getNumChildren method is deprecated.

     

    You should use the numChildren property or children.length - 1;

     

    Also, you must use a stop method to prevent the timeline from looping even in single frame Movie Clips.

     

    Please let us know if you have any further questions.

     

     

    Regards,

    JC

    1 reply

    JoãoCésar17023019
    Community Expert
    JoãoCésar17023019Community ExpertCorrect answer
    Community Expert
    March 20, 2020

    Hi.

     

    The getNumChildren method is deprecated.

     

    You should use the numChildren property or children.length - 1;

     

    Also, you must use a stop method to prevent the timeline from looping even in single frame Movie Clips.

     

    Please let us know if you have any further questions.

     

     

    Regards,

    JC

    mathieAl
    mathieAlAuthor
    Participant
    March 20, 2020

    Thank you so much. It works now.

     

    set the children.length-1 but didn't think about having a stop method on a single frame.