tags:

views:

25

answers:

1
<mx:HTTPService id="myService" url="configure.php" method="POST">
  <mx:request xmlns="">
         <mode>
            {modeLabel.text}
         </mode>
  </mx:request>
</mx:HTTPService>

<mx:Button label="Start" id="startButton" click="{myService.send()}" width="88" height="38" x="52" y="36"/>

The above code works fine i.e. the service gets started and the configure.php does it's work but instead of using click="{myService.send()}", if I use a function call (as done in following code) the service does not get started or configure.php does not perform it's work.

<mx:Script>
    <![CDATA[
private function start():void
      {

        startButton.enabled = false;
        myService.send();
      } 
]]>
</mx:Script>     

<mx:Button label="Start" id="startButton" click="start()" width="88" height="38" x="52" y="36"/>

Any idea why the service not executing when invoked from a function?

Thanks

+1  A: 

That should be working but you can try to remove the <mx:request> block and instead do this:

myService.send({mode: modeLabel.text});
James Ward
Thanks for the clue. I will try it.
baltusaj