Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

strange issue with AutoFitArea and transformAroundCenter

Recommended Posts

Really strange issue:


when I use transformAroundCenter applied to an autoFitArea object


TweenMax.to(area, 0.5, {onStart: function(){
	imgArea.removeEventListener(MouseEvent.CLICK, zoom);
transformAroundCenter: { width: fla.stage.stageHeight * (def_) * 1.3, height: fla.stage.stageHeight * 1.3 }, 

onComplete: zoomMove, ease: Strong.easeIn } );


it works only if I use:


area.preview = true;


otherwise I get this error:


TypeError: Error #1009: Impossibile accedere a una proprietà o a un metodo di un riferimento oggetto null.
at com.greensock.plugins::TransformAroundPointPlugin/onInitTween()[E]
at com.greensock.plugins::TransformAroundCenterPlugin/onInitTween()[E]
at com.greensock::TweenLite/init()[E]
at com.greensock::TweenMax/init()[E]
at com.greensock::TweenMax/renderTime()[E]
at com.greensock.core::SimpleTimeline/renderTime()[E]
at com.greensock::TweenLite$/updateAll()[E]


any help will be appreciate :)

Link to comment
Share on other sites

ps: for now I solved by setting area.alpha to 0

Link to comment
Share on other sites

What version of the TransformAroundCenter plugin are you using? It sounds like you might be using a VERY old version. You should be using 1.31. The issue simply has to do with the fact that it must use getBounds() to find out the object's bounds inside its parent, but if it doesn't have a parent, that causes problems. TransformAroundCenter was updated about 6 months ago (or maybe more) to just temporarily add the object to a blank Sprite if there's no parent, so you should be fine. Get the latest version by logging into your Club GreenSock account at https://www.greensock.com/account/

Link to comment
Share on other sites

hi jack thanks for your reply:


my transformAroundCenter:


* VERSION: 1.31
* DATE: 1/13/2010
* UPDATES AND DOCUMENTATION AT: http://www.TweenMax.com





* VERSION: 1.61
* DATE: 12/2/2009
* UPDATES AND DOCUMENTATION AT: http://www.TweenMax.com

Link to comment
Share on other sites

Ah yes, come to think of it, the object must be in the display list in order for transformAroundCenter or transformAroundPoint to work properly because it relies on localToGlobal() and globalToLocal() (there's no other way to do it as far as I can tell). So your solution of setting visible=true and alpha=0 is indeed best.

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.