Nobody guessed movieclips.
Nobody guessed sprites.
Why is that? Those are the most obvious ways to do animation.
But no, I didn’t use those.
Simply because I had a single picture and didn’t want to hire someone to create multiple frames for the animation. So while I wish the solution was more elegant, as Peach said, most people guessed the answer…
…I changed the yScale with transition.to() to compress the image, and then called it again to expand it.
The “secret” to doing that and making it look good is to set the reference point of the object to the bottom, otherwise you get both the top and bottom compressing toward the middle.
If you had a bumper that needed to boing from a hit on the side, you could do the same thing – set the reference point to the side that should stay anchored, and then do an xScale on the object.
While I used two transition.to() calls for making the boing, one to compress and one to expand, @cl-apps example code shows just a single call to transition.from(), so there are multiple ways you can use this technique to tweak things so it works best for your situation. I was looking for more control over each phase of the animation which is why I went with separate calls.
Using a compression for animation may not work well in all cases, but for this quick animation on a smaller object, it fit the bill perfectly.
Thanks to everyone who played along.
Jay
[import]uid: 9440 topic_id: 10690 reply_id: 39052[/import]