temeraire Posted December 20, 2011 Share Posted December 20, 2011 Hi, I'm trying to rotate a Sprite around its center, quickly, kind of like what you see at http://www.popchips.com/holidaycard/ with the bag on the right (after the swf finishes loading). That is, I need it to go up, spin around its center point quickly (and then, instead of landing back down, it'll keep going up and shoot out the top of the stage). It's clear how to tween the y position, but not the rotation. I've got a timeline instance which is using append() to string together a series of tweens. I'm not sure how to get that quick rotation effect -- would I use onUpdate? And how about the registration point being the center of the sprite -- is TransformAroundPointPlugin necessary for that? I'd be glad to go club green if I can see a way to do this... Thanks! Link to comment Share on other sites More sharing options...
Carl Posted December 20, 2011 Share Posted December 20, 2011 i don't see how the rotation would be anything other than a quick rotation tween. something like: var tl:TimelineLite = new TimelineLite(); tl.append(TweenLite.to(bag, .2, {y:100, ease:Back.easeOut})); tl.append(TweenLite.to(bag, .2, {rotation:720, ease:Circ.easeOut}), -.05); tl.append(TweenLite.to(bag, .2, {y:360}), -.05) I didn't go crazy trying to match the timing and easing, but it should give you the general idea. and yes, transformAroundCenter (Really Green Membership) makes it VERY easy to rotate around the center. there is a video on the Learning Resources page http://www.greensock.com/learning/ titled TransformAroundCenter Plugin Explained if you want to see it in action before purchasing. if you are loading your images with a LoaderMax ImageLoader there is also a centerRegistration property that you can use and it is free. Link to comment Share on other sites More sharing options...
temeraire Posted December 20, 2011 Author Share Posted December 20, 2011 Many thanks. So onUpdate is not, I gather, used as a substitute for onEnterFrame, i.e. if you wanted a repeated action (such as rotation) to be occuring during the tween. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now