0
<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

2
  • can you check, maybe by dispatching an Alert.show that your function is even running? it might be as simple as misspelling something. Commented Dec 21, 2009 at 3:56
  • Just FYI: You don't need braces in MXML event handlers. Commented Dec 21, 2009 at 13:49

1 Answer 1

1

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

myService.send({mode: modeLabel.text});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.