1 Reply Latest reply on Jul 21, 2008 1:53 AM by Madhav Subedi

    Passing variables

    sailPDQ36
      I am having a problem passing a public var from a MXML into a php page.
      Consider this HTTPService:

      <mx:HTTPService id="getLog" result="populateLogs(event)" showBusyCursor="true" method="POST"
      url='getlogs.php' useProxy="false">
      <mx:request xmlns=""><logno> logNo </logno></mx:request>
      </mx:HTTPService>

      logNo is a public string var declared above the HTTPService in the same mxml page nd it holds a value of "23". I get a sandbox exception error when the getlogs.php page tries to access the request element logNo (ie $logNo = $_POST["logno"];)

      I do not however get the error message when I first set a local label (label1.text=logNo) to hold the value of logNo and then set the request object to: <mx:request xmlns=""><logno>{label1.text}</logno></mx:request>

      Everything works fine using the label.text property. This seems to be rather strange to me. Am I missing something simple here? Any help would be greatly appreciated.

      Thanks,
      Tom
        • 1. Re: Passing variables
          Madhav Subedi Level 4
          <mx:request xmlns=""><logno> logNo </logno></mx:request>
          change above line to
          <mx:request xmlns=""><logno> {logNo}</logno></mx:request>

          and its is not necessary for logNo to be public, but you should indicate it bindable:
          [Bindable]
          private var logNo:Number;