Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7442807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:13:56+00:00 2026-05-29T11:13:56+00:00

is there a way to deserialize strings to objects in actionscript: i.e. var str:String

  • 0

is there a way to deserialize strings to objects in actionscript:

i.e.

  var str:String = "{ id: 1, value: ['a', 500] }";

should be made into an appropriate actionscript object.

this is not json, since the keys are not wrapped in quotes.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:13:57+00:00Added an answer on May 29, 2026 at 11:13 am

    Ok, for that type of data pattern, there’s not a nice way that I know of to do this. going off the assumption you can’t affect the data to make it more JSON-like … here’s off the top of my head what I would conceptually try:

    var str:String = "{ id:1, value:['a', 500] }";
    // strip off the { and } characters since we've nothing nice to do that for us...
    var mynewString:String = str.slice(1, str.length - 1);
    var stringItems:Array = mynewString.split(",");
    var obj:Object = new Object();
    for (var i in stringItems)
    {
        var objProps:Array = stringItems[i].split(":");
        // kill off the quotes here
        obj[props[0]] = objProps[1].slice(1, objProps[1].length - 1);
    
        if ( obj[props[0]].indexOf('[') == 0 ) {
            // remove [ and ] if there
            var maybeStrArray:String = obj[props[0]].slice(1, str.length - 1);
    
            // right now assume we're an array based on our inbound data
            var strArr:Array = maybeStrArray.split(",");
            obj[props[0]] = strArr;
        }
    }   
    

    Something like that or similar to it anyway. Yes, it’s crude, and absolutely it could be fashioned in a way that is more flexible (such as move the string to array convert to its own function so I could use it elsewhere). It’s just the first thing that conceptually came to mind as an answer.

    Try that, tweak around with it and see if it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there an easy way to deserialize a simple JSON string into a .NET
Is there any way to de/serialize an object without round-tripping a XmlDocument/temp string? I
Is there a way to deserialize a XML stream using XmlSerializer by applying a
Is there any way to deserialize in PHP an object serialized in Java? IE
I'm using .NET's JavascriptSerializer to deserialize JSON into runtime objects and for the most
I need to deserialize JSON string to custom complex objects. For example lets say
I am wondering if there is a way to use the XmlSerializer to deserialize
Is there way in next piece of code to only get the first record?
is there way thats i can preselect an item when the page loads or
is there way how to get name ov event from Lambda expression like with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.