Jump to content
Search Community

why is scrolling disabled? [SOLVED]

expeditioncirkus test
Moderator Tag

Recommended Posts

I need to be able to crop the parent of the parent containing the transformItems. But it results in a strange behavior where the whole container or parts of it disappear (or get cropped) in a reather unpredictable way. It seems dependent on the size.


I noticed that you disabled scrolling in FlexTransformManager. What is the reason for that?


In other words, how can I successfully set the scrollRect of a parent container?

Link to comment
Share on other sites

I noticed that you disabled scrolling in FlexTransformManager. What is the reason for that?


There is only one reason I did that - because there are major bugs in the Flex framework that cause all sorts of problems when scrolling is enabled. Frankly, this issue infuriates me and I've spoken directly with Adobe about it and they acknowledged the bugs and said they are indeed their fault and there is no viable workaround. I've had several Flex experts look at the issue as well, and they all confirmed that they cannot figure out any way around Adobe's bugs. Basically, when you make changes to rotation/scale/position via a UIObject's transform.matrix property, it visually renders fine but the object's container doesn't see the changes properly, so scrollbars either show up when they shouldn't or don't show up when they should. On top of that, the scrollRect doesn't respond properly either, so a UIObject is allowed to extend past the edge of a container visually instead of being clipped properly. I have burned many, MANY hours on this and was ready to strangle the Adobe developers for such huge bugs, but unfortunately there's nothing I can do about it. Again, this is not a bug in TransformManager - it's a bug in the Flex framework. When used directly in Flash (CS3 or CS4 or basically anything not involving the Flex framework), everything works great. So I created FlexTransformManager as a way to enforce bounds and prevent TransformItems from going past the edges of the container, thus avoiding the Flex bugs.

Link to comment
Share on other sites



Thanks for your elaborate answer. It helped me find a way to solve this. I only needed to modify your code by setting

_isFlex = false;

instead of

_isFlex = Boolean(getDefinitionByName("mx.managers.SystemManager")) at line 308.


In flash builder 4, I removed the FlexTransformManager component and instead added it in the creationCompleteHandler like this:

			var tTMvars:Object = {allowDelete: true};
			pTransformManager = new TransformManager(tTMvars);
			pp_transformSprite = new Sprite ();
			pTransSpriteParent = new SpriteVisualElement ();
			pTransSpriteParent.addChild (pp_transformSprite);
			pp_editGroup.addElement (pTransSpriteParent);


Where pp_editGroup is a spark.Group container that is on the stage. I had to use an intermediate SpriteVisualElement (spark) container as a parent because it handles all the child method calls from TM, which the Group container cannot. All the objects which I need to transform then gets added to the pp_transformSprite, followed by a call to TM's addItem and it works.


The parent group can now get cropped by setting its scrollRect. We wanted to do this so that the user could zoom in on different areas of the stage while editing. This solution doesn't expose any of the display corruptions I saw earlier. If its because we're cropping the new spark.Group container or if its due to the intermediate parent, I don't know. But it works.


I hope this can be of some assistance to you when you eventually upgrade TM to support Flash Builder 4 when it's released.



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