Jump to content
Search Community

How to keep handler not scale?

zrfting test
Moderator Tag

Recommended Posts


I have a sprite in UIComponent.

When the UIComponent 's  Scale change. TransformManager 's handler changed also.


How to keep handler not scale?




			public var manager:TransformManager = new TransformManager();
			protected function initApp(event:FlexEvent):void
				var sprite:Sprite = new Sprite();
				var clipItem:TransformItem = manager.addItem(sprite);
			protected function resizehandler(event:Event):void
				cont.scaleX = nativeWindow.width/200;
				cont.scaleY = nativeWindow.height/200;
			protected function cont_creationCompleteHandler(event:FlexEvent):void
	<mx:UIComponent id="cont" width="200" height="200" creationComplete="cont_creationCompleteHandler(event)"/>
Link to comment
Share on other sites

That's just how Flash works - if you scale a parent, its children also scale. I suppose you could counteract that manually by listening for a scale events and then do the math to invert the scale on the handles. So, for example, if the parent's scale is 2, the handles would be 1/2. If it's 4, the handles would be 1/4. 

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