0

I am loading my XML file using HTTPService. I am trying to load specific data depending on what the user types into the textfield. I am trying to load like this:

xmlservice.send();
var string:String = {xmlservice.lastresult.TEXTFIELD.TEXT.code};

Is there a way to do the above? When I do that I get this error: Multiple markers at this line: -xmlservice -1084: Syntax error: expecting colon before dot. -1084: Syntax error: expecting identifier before rightbrace.

RMK-Jacob
  • 209
  • 1
  • 4
  • 15
  • Its unclear whether this is your actual code or just some pseudo-code to explain the issue. Anyway, there is an error in your second line - putting {} around something defines it as an Object but you are setting "string" to be of type String. If you want to know how to extract data from the returned xml, google "actionscript e4x" –  Jan 07 '13 at 02:12

1 Answers1

0

I think you want something like this:

var string:String = xmlservice.lastresult[TEXTFIELD.TEXT].code;