title: Check to see if CallResponder is processing
body: <p>I'm using Flash Builder 4.6. As a simple example, say I have the following application:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:sdk="services.sdk.*"&gt;
      &lt;fx:Script&gt;
          &lt;![CDATA[
              private function btnGetValue_clickHandler():void
              {
                  getValueResult.token = sdk.getValue();
              }
  
              private function getValueResultHandler():void
              {
                  // ...
              }
          ]]&gt;
      &lt;/fx:Script&gt;
      &lt;fx:Declarations&gt;
          &lt;sdk:SDK id="sdk" fault="{Alert.show(event.fault.faultString +'\n\n'+ event.fault.faultDetail, 'SDK ERROR');}" showBusyCursor="false"/&gt;
          &lt;s:CallResponder id="getValueResult" result="getValueResultHandler()"/&gt;
      &lt;/fx:Declarations&gt;
      &lt;s:Button id="btnGetValue" click="btnGetValue_clickHandler()" label="Get Value" /&gt;
  &lt;/s:Application&gt;
  </code></pre>
  
  <p>So when you click on the button, it calls a PHP file and when it gets a result, it calls <code>getValueResultHandler()</code>. Easy enough.</p>
  
  <p>But what if the response from the PHP file takes a second or two and the user clicks the button rapidly? Then the result handler function may not get called every time, since the call responder gets a new token before it received the last response.</p>
  
  <p>Is there a standard way of resolving this issue? I came up with the following workaround, and it works fine, but it seems like this issue would be common enough to have a more built-in solution.</p>
  
  <p>My workaround is:</p>
  
  <pre><code>var getValueResultProcessing:Boolean = false;
  
  private function btnGetValue_clickHandler():void
  {
      var interval:uint = setInterval(function():void
      {
          if (!getValueResultProcessing)
          {
              getValueResultProcessing = true;
              getValueResult.token = sdk.getValue();
              clearInterval(interval);
          }
      }, 100);
      getValueResult.token = sdk.getValue();
  }
  
  private function getValueResultHandler():void
  {
      getValueResultProcessing = false;
      // ...
  }
  </code></pre>
  
  <p>Any better way of resolving this issue?</p>
  
  <p><hr />
  <strong>EDIT:</strong></p>
  
  <p>One of my actual scenarios for which I need a solution is when looping:</p>
  
  <pre><code>private function btnGetValue_clickHandler():void
  {
      var arr:Array = new Array("value1", "value2", "value3");
      for each (var value:String in arr)
          getValueResult.token = sdk.getValue(value);
  }
  </code></pre>
  
  <p>So to solve this problem I make <code>arr</code> a global variable and use the <code>setInterval</code> method I described before to <code>shift</code> off the first element and then do the same exact thing in the result function until <code>arr</code> is empty.</p>
  
  <p>Again, looking for a more "standard" solution, if such a thing exists.</p>