Jump to content
Search Community

nouatzi

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by nouatzi

  1. Yes, I've tried this, and it's working, I mean it did Transform Around Center. But with the mouse over the component, it keeps animating from my onOver and onOut functions. I know it's a boundary issue due to the transformation, that I've already solved earlier with a Shape button, by using some customized container...

    I thought I could use "easily" those UIcomponents from fl.controls with some of your really nice tweening....

    Well, knowing that UIcomponents are AS3, I've located the UIcomponents.as on my Flash folder. So do you think it could "easy" to modify some stuff inside it to solve that problem for all my UIcomponents ? And what could I modify ?

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

    com\greensock\plugins\TransformAroundCenterPlugin.as
    and tried to manually set things with :
    bounds.x = target.x;
    bounds.y = target.y;

    but without success...

    Any idea ?

    Thanks

×
×
  • Create New...