Hi, I think, you cant just send a typed object (a value object) like that. You will need services like RemoteObject to do that. The basic problem is that for a typed object, Flex will first serialize it in byte array (in AMF format) and then deserialize it back on the server side.
If you will look at the data property in API: data property data:Object [read-write] An object containing data to be transmitted with the URL request. The URLRequest API offers binary POST support and support for URL-encoded variables, as well as support for strings. The data object can be of ByteArray, URLVariables, or String type. This clearly specifies that data cannot be custom object. If its a custom object, then it needs to be first serialized in a byte array. Regards, Sandeep --- In [email protected], "mleembruggen" <[EMAIL PROTECTED]> wrote: > > I have made a custom class to use like a valueobject. I want to use > it as the URLRequest.data property ... but it doesn't work. > > If I create a new Object() and populate it with variables it does > work.... ??? I can't see what the difference is between these objects > and why the server would care what type of object it is. > > Here is a code example: > > > package com.paypal.vo > { > public class RecurringBilling > { > > public var cmd:String = "_xclick-subscriptions"; > public var business:String = "[EMAIL PROTECTED]"; > public var a3:String ="120"; > public var p3:String = "1"; > public var t3:String = "Y"; > public var no_note:String = "1"; > > public var item_name:String = "Recurring Fee"; > public var item_number:String; > > public var no_shipping:String = "1"; > public var currency_code:String = "AUD"; > public var custom:String; > public var src:String = "1"; > public var sra:String = "1"; > } > } > > > > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > layout="absolute" creationComplete="init()"> > <mx:Script> > <![CDATA[ > import flash.net.navigateToURL; > import com.paypal.vo.RecurringBilling; > > private function init():void{ > var paypalURL:URLRequest = new URLRequest > ("https://www.paypal.com/cgi-bin/webscr"); > paypalURL.method = "POST"; > > //this is the object I would like to send > var recurringBilling:Object = new RecurringBilling(); > > > var recurringBillingVariables:URLVariables = new URLVariables(); > recurringBillingVariables.cmd = "_xclick-subscriptions"; > recurringBillingVariables.business = "[EMAIL PROTECTED]"; > recurringBillingVariables.a3 ="120"; > recurringBillingVariables.p3 = "1"; > recurringBillingVariables.t3 = "Y"; > recurringBillingVariables.no_note = "1"; > recurringBillingVariables.item_name = "Recurring Fee"; > recurringBillingVariables.no_shipping = "1"; > recurringBillingVariables.currency_code = "AUD"; > recurringBillingVariables.src = "1"; > recurringBillingVariables.sra = "1"; > > paypalURL.data = recurringBillingVariables; //I want to use > recurringBilling custom class here > > navigateToURL(paypalURL); > } > ]]> > </mx:Script> > </mx:Application> >

