Asynchronous JSON Decoder

Extremely lightweight JSON decoder with all the features you can possible want.

  • Language: ActionScript
  • Released: May 19, 2011
    Last Update: Feb 16, 2014

A fully featured but lightweight JSON decoder component. Decodes a JSON string into an object using the following features:

  • Extremely lightweight with blazing performance
  • Async decoding with various settings like max processing time, max time for the whole decoding
  • Auto reprocessing, time to delay before the next async call
  • Decodes strings and keys enclosed with " or ' (can decode keys without any quotes)
  • Block and inline comments are available with export option during the decoding process
  • Exports tags from the value field (supports custom tag names by calling mapped methods)

Script Tag Evaluation Plugin is included in this package with the open source Hurlant Evaluation Library

Examples are included

Hide

Async decoding

var decoder:JSONDecoder=new JSONDecoder();
decoder.addEventListener(Event.COMPLETE, OnDecoded);

JSONDecoder.DefaultAsyncIterationsPerMs=1500;//default iterations for 1ms - use with maxAsyncProcessTime

decoder.maxAsyncProcessTime=30;//default time in ms to process 1 async decoding frame, very useful when working with really large json objects in order to prevent application halting!

decoder.maxAsyncTime=2000;//default time in ms to prevent application halting - reduces iterations when reached

decoder.asyncTime=0;//default time to wait before the next async decoding

decoder.autoReprocessBelowPercent=.7;//default autoreprocess time - when 1 async decoding frame is finished there's a chance to process another one, if the desired iterations per frame are processed for less time

decoder.exportComments=true;//default is false - marks the option to export the string content of the inline/block comments
//Use decoder.exportedComments to access them

decoder.DecodeString(jsonString, null, true);

function OnDecoded(event:Event) : void
{
    var decodedData:Object=decoder.output[0];//Note that every json structure is considered an array. In most cases you'll get the zero indexed object
}
You need to log-in or create an account
  • Create an account
  • Log-in

Please use your real name.

Activation link will be sent to this address.

Minimum 8 characters

Enter your password again

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

X

Save your watchlist

Fill your details below to receive project updates from your watch list - including new versions, price changes and discounts.

I agree to the terms of use and privacy policy.

1 license From » FREE View Licenses 14 day money-back guarantee
  • perfect
    IY Ivo Yankulovski
    2 years ago, 0 comments
    Was this helpful?
    Flag 1 of 1 people found this review helpful
Post a comment

Or enter your name and Email
No comments have been posted yet.