1 Reply Latest reply on Jul 19, 2010 10:24 AM by rootsounds

    XML Object not population httpservice.request

    mumcs01 Level 1

      I'm fighting with XML again. This is a basic application below that I"m making custom XML tags and sending them via HTTPSERVICE (Called driver) eack time the user clicks 'check_dimmer'. So I want to send:


           <C5 level="50" />



      if the user has 5 in check_number and 50 in check_level. I have used e4x before forf other applications and have either forgotten how to do this, order a large change has occured since I switched to Flex 4. I seem to get NO object populated into driver.request via debug ever. To make it worse I can't really see what the output is. (A second question would be, is there a way of redirecting httpservice during developement to debug output to a text file).


      Anyway, any help below woudl be great.




      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="200">

         import mx.utils.StringUtil;
         protected function check_dimmer_clickHandler(event:MouseEvent):void
          var params:Object = {};
          params['setlevels'] = StringUtil.trim("<C" + check_number.value + " level=\"" + check_level.value +"\"/>");

          driver.send( params );

        <!-- Place non-visual elements (e.g., services, value objects) here -->
        <s:RadioButtonGroup id="test_type" />
        <s:HTTPService id="driver" url=""
            method="POST" showBusyCursor="true" resultFormat="e4x" />
          <!--  result="driver_result(event)" fault="faultHandler(event)" />-->
      <s:Button id="check_dimmer" x="283" y="32" label="Check" width="91" height="38" click="check_dimmer_clickHandler(event)" />
      <s:Button id="last_dimmer" x="270" y="87" label="&lt;" width="42" height="38"/>
      <s:Button id="next_dimmer" x="349" y="87" label="&gt;" width="42" height="38"/>
      <s:Button id="release" x="283" y="143" label="Release" width="91" height="38"/>
      <s:RadioButton x="14" y="72" groupName="test_type" label="Dimmer Check" width="113" selected="true"/>
      <s:RadioButton x="14" y="107" groupName="test_type" label="Dimmer Set" width="113"/>
      <s:NumericStepper id="check_number" x="135" y="26" height="124" width="114" fontSize="60"
             fontFamily="Verdana" textAlign="center" minimum="1" maximum="96"
             stepSize="1" maxChars="2" />
      <s:NumericStepper id="check_level" x="165" y="158" height="30" width="71" fontSize="15"
             fontFamily="Verdana" textAlign="center" minimum="0" maximum="100"
             stepSize="1" maxChars="3" />