I'm making an interaction where you have 9 cards on one side of the screne and you have to drag and drop them onto 3 piles.
I have it so when you roll over a card, it scales up and becomes the front-most card.
What I want to have happen, is when you roll away from it, it goes back to the depth at which it started.
This is the code I tried: private function rollCard(event:MouseEvent):void
this.scaleX = 1.5;
this.scaleY = 1.5;
event.target.parent.addChild(event.target); //makes the current card go in front of the rest
Hi! I think you may be adressing the wrong container in the Roll Away-function. When elements inside the card (i.e. the text, and bg graphics I assume) change places instead of the card itself, this may be the cause. Instead you must target the parent: it's the parent's children ('the cards in the deck') you want to swap - no? - not it's children's children ('the elements of that card').
I don't guarantee this is the solution, but I hope this helps you solving it.
Not everything that can be counted counts, and not everything that counts can be counted.