Share Posted December 22, 2013 Hi 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(); sprite.graphics.beginFill(0xffdd00); sprite.graphics.drawRect(0,0,100,100); cont.addChild(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 { nativeWindow.addEventListener(Event.RESIZE,resizehandler); } ]]> </fx:Script> <mx:UIComponent id="cont" width="200" height="200" creationComplete="cont_creationCompleteHandler(event)"/> Link to post Share on other sites
Share Posted December 23, 2013 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 post Share on other sites