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

171

Likes

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

Adobe Community Professional , 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

Likes

Translate

Translate
Adobe Community Professional ,
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

Likes

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. 


Likes

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