hussainahmad / as3corelib

Automatically exported from code.google.com/p/as3corelib
0 stars 0 forks source link

JSON treats Vector as Object, not Array #106

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Workaround:

In JSONEncoder.as:

- Remove make parameter a untyped in arrayToString, like so:

        private function arrayToString( a ):String {

- Add this case to convertToString:

            else if ( 
getQualifiedClassName(value).split(':')[0] == '__AS3__.vec') {

                return arrayToString(value)

            }

- import flash.utils.getQualifiedClassName

Original issue reported on code.google.com by bsimpson on 29 May 2009 at 10:53

GoogleCodeExporter commented 8 years ago
Would the correct type of test not be
else if ( value is Vector.<*> )
{
return arrayToString( vectorToArray( value ) )
}

Original comment by WORMSSm...@gmail.com on 5 Jul 2011 at 2:08