• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Stacking cards - z-index

New Here ,
Mar 20, 2020 Mar 20, 2020

Copy link to clipboard

Copied

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?

 

Views

336

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 20, 2020 Mar 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

Votes

Translate

Translate
Community Expert ,
Mar 20, 2020 Mar 20, 2020

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 20, 2020 Mar 20, 2020

Copy link to clipboard

Copied

LATEST

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. 


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines