Hi everybody,
I'm facing the same problem in Flash AS3, with UI Components from fl.controls :
import fl.controls.Button;
TweenPlugin.activate([TransformAroundCenterPlugin]);
var myButton:Button;
myButton = new Button();
myButton.setSize(100, 50);
myButton.move(200, 200);
myButton.label = "Validate";
myButton.addEventListener(MouseEvent.ROLL_OVER,onOver,false,0,true);
myButton.validateNow();
mainCTR.addChild(myButton); // mainCTR : it's my container
private function onOver(e:MouseEvent):void {
myButton.removeEventListener(MouseEvent.ROLL_OVER,onOver);
myButton.addEventListener(MouseEvent.ROLL_OUT,onOut,false,0,true);
TweenMax.to(myButton,1,{transformAroundCenter:{scaleX:1.5,scaleY:1.5}});
}
private function onOut(e:MouseEvent):void {
myButton.removeEventListener(MouseEvent.ROLL_OUT,onOut);
myButton.addEventListener(MouseEvent.ROLL_OVER,onOver,false,0,true);
TweenMax.to(myButton,1,{transformAroundCenter:{scaleX:1,scaleY:1}});
}
It's still acting with the original registration point.
I have notice that
trace(myButton.getBounds(myButton))
returns
(x=0, y=0, w=100, h=50)
, so I took a look on my
and tried to manually set things with : bounds.x = target.x;
bounds.y = target.y;
but without success...
Any idea ?
Thanks