Share Posted February 13, 2011 Is there a way to zoom upon the users mouseclick on the stage. for instance if the user click on certain part of the page it will then zoom from that point. Is transformAroundCenter the way to go about this? Link to comment Share on other sites More sharing options...
Share Posted February 13, 2011 No, transformAroundCenter wouldn't apply because I assume you cannot expect the user to always click exactly on the center of the object, but transformAroundPoint might help. Since you probably want that point to move so that it's centered in some area/window/mask, you'd also want to add x and y properties to that transformAroundPoint rather than just scaleX/scaleY. Kinda like: TweenLite.to(mc, 1, {transformAroundPoint:{point:new Point(this.mouseX, this.mouseY), scaleX:3, scaleY:3, x:stage.stageWidth / 2, y:stage.stageHeight /2}}); Obviously you may need to tweak some of those values, but hopefully it gives you the general idea. And remember that transformAroundPoint is only available to "Really Green", "Shockingly Green", and corporate Club GreenSock members. Link to comment Share on other sites More sharing options...
Share Posted February 23, 2011 Not to take away from the awesome Transform manager in greensock, but if your looking to zoom in and out with a lot of objects or if your object don't have a proper hierarchy it might be worth getting AS3 vCam and then tweening that object with greensock TweenMax/Lite. Have a look see here: http://bryanheisey.com/blog/?page_id=12 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