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

  • SEARCH
  • Home
  • 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 6604635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:11:00+00:00 2026-05-25T19:11:00+00:00

I am working on an inDesign Extension in flex where I am encoding an

  • 0

I am working on an inDesign Extension in flex where I am encoding an object to JSON and then later trying to create an object from the JSON String.

The Class I am encoding with JSOD.encode()
public class ManualProductLink {

    private var _productID:String;
    private var _productName:String;
    private var _productDescription:String;
    private var _productPrice:String;

    public function ManualProductLink(productID:String, productName:String, productDescription:String, productPrice:String):void {
        this._productID = productID;
        this._productName = productName;
        this._productDescription = productDescription;
        this._productPrice = productPrice;
    }

    public function get productID():String
    {
        return _productID;
    }

    public function set productID(value:String):void
    {
        _productID = value;
    }

    public function get productName():String
    {
        return _productName;
    }

    public function set productName(value:String):void
    {
        _productName = value;
    }

    public function get productDescription():String
    {
        return _productDescription;
    }

    public function set productDescription(value:String):void
    {
        _productDescription = value;
    }

    public function get productPrice():String
    {
        return _productPrice;
    }

    public function set productPrice(value:String):void
    {
        _productPrice = value;
    }

}

This is the function where I encode the object

        /**
     * Creates ManualProductLink, encodes to JSON and sends it to AsCppBridge
     */
    public function manualProductLink(productID:String, productName:String, productDescription:String, productPrice:String):void {
        var manualProductLinkl:ManualProductLink = new ManualProductLink(productID, productName, productDescription, productPrice);
        bridge.saveManualProductLink(JSON.encode(manualProductLinkl));
    }

The resulting JSON String is:

{"productName":"testName","productDescription":"testDescription","productID":"testID","productPrice":"100.00"}

My problem is in decoding the String, I am trying some thing like this:

public function getManualProductLinkJSON():ManualProductLink {
        var jsonString:String = bridge.getManualProductLink() as String;
        var data:ManualProductLink = JSON.decode(jsonString) as ManualProductLink;

        var manualProductLink:ManualProductLink = new ManualProductLink(data.productID, data.productName, data.productDescription, data.productPrice);

        return manualProductLink;
    }

however trying to get variables from the returned object like this:

var str:String = manualProductLink.productID;

doesn’t work for me.

I would appreciate some help decoding the JSON String to an object similar to the original object.

  • 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-25T19:11:01+00:00Added an answer on May 25, 2026 at 7:11 pm

    Seems like I can answer my own question:

    public function getManualProductLinkJSON():ManualProductLink {
        var jsonString:String = bridge.getManualProductLink() as String;
        var data:Object = JSON.decode(jsonString);
    
        var manualProductLink:ManualProductLink = new ManualProductLink(data.productID, data.productName, data.productDescription, data.productPrice);
    
        return manualProductLink;
    }
    

    I could not decode directly in to the encoded object, but by decoding in to data:Object it was possible to recreate the original object.

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

Sidebar

Related Questions

Working on a project that parses a log of events, and then updates a
Working with an Oracle 9i database from an ASP.NET 2.0 (VB) application using OLEDB.
I'm currently designing a custom tab control class which derives from System.Windows.Forms.Control. The problem
I'm working with swf's generated by InDesign CS5, which will apparently only export text
Working on dom html . I want to convert node value to string: $html
Working on a end of the year project for school and chose to create
I am working on an Access database. I am trying to write a query
In working with MS Expression Blend, you can import sample data from an XML
I'm trying to get scrollbars working with the web browser control. However, as I'll
Working in Design mode on Visual Studio 2010... I am trying to get an

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.