263 posts
  • Antarctica
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Sold between 100 and 1 000 dollars
x360c says

I am working on a system to transfer data to any language. I can encode, but I can’t seem to decode them.

Here’s the string:
title01:Basic Thread;posts:{0:{author:9;message:blah};1:{author:54;message:blah};2:{author:11;message:blah};};
Can someone help me start to split that into:
vars[title01]
vars[posts]
vars[posts][0]
vars[posts][0][author]
vars[posts][0][message]
vars[posts][1]
vars[posts][1][author]
vars[posts][1][message]
vars[posts][2]
vars[posts][2][message]
vars[posts][2][message]

Any help AT ALL would be appreciated =)

3256 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Exclusive Author
  • Interviewed on the Envato Notes blog
  • Beta Tester
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
+4 more
ParkerAndKent says

Is that string serialized?

263 posts
  • Antarctica
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Sold between 100 and 1 000 dollars
x360c says
Is that string serialized?
What do you mean?
3256 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Exclusive Author
  • Interviewed on the Envato Notes blog
  • Beta Tester
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
+4 more
ParkerAndKent says

title01:Basic Thread;posts:{0:{author:9;message:blah};1:{author:54;message:blah};2:{author:11;message:blah};};

How do you obtain this string? Are you using some server side script to create this string?

3256 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Exclusive Author
  • Interviewed on the Envato Notes blog
  • Beta Tester
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
+4 more
ParkerAndKent says

Anyway if you need to transport complex objects as arrays from actionscript to many other languages I suggest you to encode and decode these objects with JSON

http://www.json.org/

There are as 2 and as 3 classes to work with it ;-)

375 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • United States
Nythe says

You could put this information in an XML object instead and it would be much easier to access the separate components of the string.

563 posts
  • Bought between 1 and 9 items
  • Brazil
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 1 and 9 users
  • Sold between 100 and 1 000 dollars
LuizZak says

I’ll have a try to undoce this :)

279 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Netherlands
  • Referred between 10 and 49 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 10 000 and 50 000 dollars
FonZ says

looks serialized to me btw. Do you pull this out of a text file or something? If so, use php to unserialize it. Use php.net to figure it out.

107 posts
  • Has been a member for 5-6 years
  • Sold between 100 and 1 000 dollars
the_asman says

as2 or as3?

900 posts
  • Beta Tester
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 7-8 years
  • Netherlands
  • Referred between 50 and 99 users
  • Sold between 10 000 and 50 000 dollars
michelsteege says
You could put this information in an XML object instead and it would be much easier to access the separate components of the string.

Disagree, Like ParkerAndKent said use json to do this (also look at the adobe core lib in there is a json connector and encoder/decoder) it is much faster then xml and easyier. you just get a object or array that you can acces :)

by
by
by
by
by
by