263 posts
  • 7 Years of Membership
  • Antarctica
  • Author Level 2
  • Collector Level 1
+2 more
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
  • Affiliate Level 4
  • Author Level 9
  • Collector Level 2
  • Top Monthly Author
+11 more
ParkerAndKent
says

Is that string serialized?

263 posts
  • 7 Years of Membership
  • Antarctica
  • Author Level 2
  • Collector Level 1
+2 more
x360c
says
Is that string serialized?
What do you mean?
3256 posts
  • Affiliate Level 4
  • Author Level 9
  • Collector Level 2
  • Top Monthly Author
+11 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
  • Affiliate Level 4
  • Author Level 9
  • Collector Level 2
  • Top Monthly Author
+11 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
  • 7 Years of Membership
  • Affiliate Level 1
  • Author Level 3
  • Collector Level 1
+2 more
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
  • 7 Years of Membership
  • Affiliate Level 1
  • Author Level 2
  • Brazil
+2 more
LuizZak
says

I’ll have a try to undoce this :)

279 posts
  • 7 Years of Membership
  • Affiliate Level 2
  • Author Level 5
  • Collector Level 1
+5 more
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
  • 7 Years of Membership
  • Author Level 2
the_asman
says

as2 or as3?

940 posts
  • Affiliate Level 3
  • Author Level 5
  • Collector Level 2
  • Top Monthly Author
+5 more
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