3 Replies Latest reply on Dec 21, 2007 9:14 AM by

    Access of undefined property

      Env: Flex Builder 3 Beta 3
      Here's the mxml file, but why did I get "Access of undefined property" for
      customerData = event.result.cutomer as XML?

      <mx:HTTPService id="customer_RO" result="customer_RO_Handler(event);"
      resultFormat="e4x"
      url=" http://localhost/flexApp/getCustomer.cfm" useProxy="false" method="POST">
      </mx:HTTPService>

      <!-- getCustomer.cfm output data in xml format
      root note: customers
      its direct child note: customer
      -->

      <mx:Script>
      <![CDATA[
      import mx.rpc.events.ResultEvent;

      public function customer_RO_Handler(event:ResultEvent):void
      {
      customerData = event.result.cutomer as XML;
      }
      </mx:Script>

      Thank you.
        • 1. Re: Access of undefined property
          adding
          var customerData:XML // datatype of XML
          prior to the function does not help neither. People, what's going on?

          Compilation without error but execution complained about malform.

          thks.
          • 2. Re: Access of undefined property
            Ivascu Cristian Level 1
            Hi,

            The error you first mentioned is caused by the lack of the proper variable definition for customerData.
            As for the malformed error, you need to see what actually comes back from the service - perhaps it has invalid characters in the xml definition tag, or some other sort of issue.
            One simple way to see this is to add a breakpoint in the customer_RO_Handler method and copy the output of the service.
            If all looks right, file a bug at http://bugs.adobe.com/flex and attach the mxml code as well as a snippet of the xml file.

            Thanks,
            Cristian
            1 person found this helpful
            • 3. Re: Access of undefined property
              I'm using a plain coldfusion template that outputs as XML (I've manually output to see it's a valid one), using the default send() method that's provided by HTTPService to retrieve data at applicationComplete point, not sure if I can add a breakpoint here...

              Also, I seem to have found a bug, with web serivce, pointing to 127xxx for local machine is ok while using HTTPService complained about malform. And since the web service is doing some rudimentary stuff, I'll just forget about the HTTPService for now.

              Thanks.

              Don