2 Replies Latest reply on Feb 5, 2015 12:10 PM by KavinKannan

    What happens differently when a method inside another method is declared within curly braces '{}' ?

    KavinKannan Level 1


      I am working in a project in which the legacy way of invoking a click_handler from MXML is as following:

       

       <s:Button click="{btnClickHandler(event)}" />
      
      
      
      

       

      Notice that the click handler is declared inside Binding brackets- ' { } ', like the way it is used for property bindings.

      This works with no issues, however I am concerned if the framework tries to bind the method handler, or if there would be any performance impact.

       

      In the generated action script class, I see that this method is created in the following format,

      // This method is generated by the compiler where the native click_handler in-turn calls user declared click_handler
      public function ___ClickHandlerBindingExample_Button1_click(event:flash.events.MouseEvent):void
      {
        {btnClickHandler(event)}
      }
      

       

       

      What happens differently when a method inside another method is declared within curly braces '{}' ?

      Is there a binding assigned to the method if declared in such a way, if so how can I find it.

      Or is there any kind of performance impact due to this syntax ?