As to the "worth": what is the cost, really? I mean, it's not really likely this will be called from a long loop, so that one comparison probably is "worth it".
I also like how it's self documenting the issue. EdB On Mon, Feb 24, 2014 at 9:18 AM, Justin Mclean <jus...@classsoftware.com>wrote: > Hi, > > This works - but is it really worth it? > > public function toJSON(s:String):* > { > var array:Array = toArray(); > > if (ApplicationDomain.currentDomain.hasDefinition("JSON")) > { > var json:Class = > Class(ApplicationDomain.currentDomain.getDefinition("JSON")); > return json["stringify"](array); > } > else > { > return '{"error": "Not supported on Flash Player > 10"}'; > } > } > > Thanks, > Justin -- Ix Multimedia Software Jan Luykenstraat 27 3521 VB Utrecht T. 06-51952295 I. www.ixsoftware.nl