Koden
Koden

Reputation: 353

setChildIndex to value directly below target object

Looking to set an objects index value to -1 that of the specified object.

this.setChildIndex(box, circle.index-1);

I thought this would work but I apparently I am wrong. I am trying to get the box directly below the circle index which has an index value that changes constantly. Does anyone know how to accomplish this?

Upvotes: 0

Views: 33

Answers (1)

Koden
Koden

Reputation: 353

using the getChildIndex method I was able to accomplish this
solution:

this.setChildIndex(box, this.getChildIndex(circle)-1);

Upvotes: 1

Related Questions