views:

112

answers:

1

I'm trying to assemble a header object for an api request. One of the headers is 'Content-Type'. The hyphen is causing a compile error. Flex is giving me:

1050 - Cannot assign to a non-reference value.

I find it spiteful that they enjoy the use of a hyphen in the error message while I hang my head and come here for answers.

A: 

You can't have a hyphen (minus sign) in your variable name. For example, if you try to have a variable a-b = 3, Flex thinks you're talking about subtraction.

The documentation gives info about how to set headers:

var header:URLRequestHeader = new URLRequestHeader("Content-Type", "text/plain");
request.requestHeaders.push(header);
John
That's a huge help. But how do I parse the result when the incoming xml uses hyphens?
John Leonard