Jump to content
Search Community

TransformAroundCenter/Point & PopUpManager

JonDum test
Moderator Tag

Recommended Posts

Using tranformAroundCenter inside of a popup created with mx.managers.PopUpManager doesn't seem to be working correctly.

 

Maybe because the parent of a popup created with PopUpManager.createPopUp is mx.managers.SystemManager, and not stage.

 

When tweened, the transformAroundCenter seems to tween normally, as if the calculated registration point was where the actual registration point is (importing, activating everything correctly; no error is thrown when transformAroundCenter:{} is used).

 

Any thoughts?

Link to comment
Share on other sites

I wonder if there are bugs in Adobe's SystemManager or PopUpManager classes that prevent getBounds() from working properly. And are you sure that your object has fully instantiated before you tween it? TransformAroundCenterPlugin needs to be able to accurately measure the object's width/height and do a getBounds() call on it in order to work. And your object is added to the display list before you tween it, right? Any chance you could post an example FLA that demonstrates the issue? It makes troubleshooting a LOT more efficient.

Link to comment
Share on other sites

Here you are. Thanks for taking a look. I left a few comments/instructions in the creationComplete handler in CustomThing.as.

 

What's odd is that in the project I'm working on for work I got different results than this test project I made. The only difference between the two is the PopUpManager.centerPopUp() in this one, versus me manually centering the popup in updateDisplayList(), which is basically the what centerPopUp is doing.

Link to comment
Share on other sites

Yep, it's yet another bug in the Flex framework, not TweenMax or the TransformAroundCenter plugin. When your CREATION_COMPLETE handler gets called, do a trace(this.getBounds(this.parent)) and you'll see something quite different than if you called it 0.1 seconds later. Basically, when you start your tween, Flex still hasn't positioned it properly even though it says that the object's creation is complete (wink, wink, yeah right).

 

I removed your addEventListener(FlexEvent.CREATION_COMPLETE, onComplete) line and replaced it with TweenMax.delayedCall(0.1, onComplete, [null]); and vwalla! It worked properly.

 

This is one of the reasons why I'm not a fan of Flex. In my experience, the framework is riddled with bugs like this which is maddening. (sorry all you Flex fans out there)

Link to comment
Share on other sites

This is one of the reasons why I'm not a fan of Flex. In my experience, the framework is riddled with bugs like this which is maddening. (sorry all you Flex fans out there)

 

Maddening, to say the least.

 

Flex drives me absolutely nuts sometimes. You'd think they'd fix Flex 3 before releasing Flex 4 :|

 

I also noticed some really funny stuff with that same example where when the Elastic.easeOut was too strong for the animation and the bounds got negative, flipped, and it started drawing the thing as a circle! haha.

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...