Jump to content
Search Community

Shuffle cards animation

Astraport test
Moderator Tag

Recommended Posts

Hi!

 

I'm trying to organize animation of shuffle cards in the deck. Using TweenLite.

 

I created 5 Bitmap and put its in a stack as shown. I need to move cards one after another. One card from the middle deck moved to the right and then returned to the deck, but was below the level of all. Others also take turns moving above or below the other cards.

 

Thanks for the tips.

Link to comment
Share on other sites

it will be drastically different depending on whether you use AS2 or AS3. AS3 will be much easier. If using AS3 google "AS3 DisplayList tutorial".

 

unfortunately shuffling depths (stacking order) of cards is a bit beyond the type of support we give here.

 

in general you will use a tween to slide a card out and then probably call a function that will handle putting it at another depth and then tweening it back to position.

 

you could do something like this with AS3:

//move card 2 out of the stack to the right
TweenLite.to(card2_mc, 1, {x:200, onComplete:placeOnTop, onCompleteParams:[card2_mc]});

function placeOnTop(mc:DisplayObject):void{
    //place card on top
    addChild(mc)
   TweenLite.to(mc, 1, {x:originalPosition});
}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...