Beta4
Beta4

Reputation: 111

Actionscript/Flex string to array

I'm working with a 3rd party web service and it's returning a string like the below. I'm completely stuck on how to parse this into a usable format. It appears it's an array, just in text format.

[["theData",{"something":somevalue,"details":null,"somethingElse":"something"},0]]

It could also have multiple, like

[["theData",{"something":somevalue,"details":null,"somethingElse":"something"},0],["theData",{"something":somevalue,"details":null,"somethingElse":"something"},0]]

I've tried setting the HTTPService result type as array/arraycollection, that doesn't work. The only thing I can think is to do some sort of string split/join.

Upvotes: 0

Views: 242

Answers (1)

JeffryHouser
JeffryHouser

Reputation: 39408

That looks like JSON to me; so I would look into using the Flash Player's native JSON classes.

If you really want to use String parsing; then I'd look into the split() function; which will turn it into an Array. But, it seems like you'd be stuck doing string parsing to get every value.

Upvotes: 1

Related Questions