2 Replies Latest reply on Apr 14, 2011 6:26 AM by bucpatr1

    Unexpected behavior when listening for 'currentStateChange'

    bucpatr1 Level 2

      In one of my projects I was trying to call a function when the view state of an Application component changed. In the mxml of the Application tag I added:

      currentStateChange="{someFunctionX(event) }" just like I would any other time I want to add an event handler in mxml. I ran the application and nothing happened. I then tried setting a break point inside the handler function ( someFunctionX) and FlashBuilder indicated that the breakpoint was invalid because that code was unreachable.

       

      After a lot of trial and error I finally managed to get it working by removing the curly braces from around the outside of the inline handler so that it looked like this:

      currentStateChange="someFunctionX(event)"

       

      Does anyone know why the application tag behaves like this? I've never had this issue with any other component. Is this a bug or is s:Application supposed to work that way?