There's no point in having binding braces, in either example.

Paul
  ----- Original Message ----- 
  From: Roman Protsiuk 
  To: flexcoders@yahoogroups.com 
  Sent: Tuesday, February 20, 2007 9:36 AM
  Subject: Re: [flexcoders] Quick Question


  As far as I remember someone once told me... :)

  When you write:
  <mx:Button x="23" y="242" label="Button" click="{myFunction()}" />
  or
  <mx:Button x="23" y="242" label="Button" click="{foo = bar;}" />
  the event handler (function) is generated dynamically.
  So writing
  <mx:Button x="23" y="242" label="Button" click="{myFunction()}" />
  means that some method will be generated by compiler and it will call 
myFunction().
  If you don't use braces myFunction used for handling event and no additional 
function is generated. 

  Am I right?

  R.


  On 2/20/07, Paul Andrews <[EMAIL PROTECTED]> wrote:

    ----- Original Message ----- 
      From: Kumar 
      To: flexcoders@yahoogroups.com 
      Sent: Tuesday, February 20, 2007 7:35 AM
      Subject: [flexcoders] Quick Question


      Hi All,





      Just a quick one guys just had a little confusion in two statements below



      First:

        <mx:Button x="23" y="242" label="Button" click="myFunction()" />




    This is just calling "myFynction()" in response to the button click.



      Second:

        <mx:Button x="23" y="242" label="Button" click="{myFunction()}" />



    Here, you have the same as above, but you are (for some reason) trying to 
wrap the function call in a binding which is having no effect in this context, 
so the effect is the same.



    Perhaps some research on Flex binding will help.



    Paul



      Both Buttons give the same result…

      Just a bit confused…











   

Reply via email to