Coder Social home page Coder Social logo

as3corelib's Issues

Standardize the API for image encoders

The PNG encoder uses a static function "encode" while the JPG encoder 
requires an instance of JPGEncoder.  

It would be nice if one method was chosen and used for both for ease of 
switching between them.  This would then pave the way for future encoding 
formats and would support reflection.

Original issue reported on code.google.com by [email protected] on 4 Jun 2007 at 5:59

Enter one-line summary

What steps will reproduce the problem?
1. attach source path
2. copy and paste JSON example in the download
3. Get error in Problems window: 1061: Call to a possibly undefined method
decode through a reference with static type Class.  JSON.mxml   JSON    line 14
April 26, 2007 1:27:25 AM   2231


What is the expected output? What do you see instead?
No errors, Errors

What version of the product are you using? On what operating system?
I don't know but I checked for updates on subversion

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 26 Apr 2007 at 6:40

Support for Binary MD5 hash - code included

It is not currently possible to create an MD5 hash of a Binary object - eg
for a image verification.

The code can support this functionality with only some minor changes and no
loss of backward compatibility.

I would really appreciate it if you could review these changes and include
them in the as3corelibs as I believe they are useful changes.

Regards,
Mark

Please find code attached.

Summary of code changes:

 - Rename hash function to be hashBinary.
 - Change parameters of hashBinary to accept a ByteArray
 - Change parameters of createBlocks to accept a ByteArray
 - Change createBlocks to use array reference instead of s.getCharCodeAt()
 - Create new hash() function which converts string to ByteArray and then
call hashBinary passing in the ByteArray.


Original issue reported on code.google.com by [email protected] on 14 Jan 2008 at 11:37

Attachments:

isWhiteSpace() in JSONTokenizer.as is only checking for 3 of the 4 white space characters

What steps will reproduce the problem?
1. Create a JSON string with '\r' as white space.
2. Run JSON.decode on that string
3.

What is the expected output? What do you see instead?

Should ignore '\r' as white space per RFC.  Instead get parse error due to 
unexpected character.

What version of the product are you using? On what operating system?

0.9 dated March 19.  Windows XP

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 12 Jul 2007 at 11:23

JSONParseError raised in JSONParseError.as has 'name' key commented out.

What steps will reproduce the problem?
1. Pass a broken json string to a Flex app using corelib.as (import
com.adobe.serialization.json.JSON;)
2. Walk through the parsing in your favorite debugger.
3. If the parser breaks it will enter into JSONParseError.as and attempt to
define a JSONParseError.  The name key is commented out.

See line 60 in JSONParseError.as

Here is the source code:

public function JSONParseError( message:String = "", location:int = 0,
text:String = "") 
{
  super( message );
  //name = "JSONParseError";
  _location = location;
  _text = text;
}

What is the expected output? What do you see instead?
In flex I would like to catch the error using error.name, I can't do this
with the field commented out.


What version of the product are you using? On what operating system?
as3corelib

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 4 Aug 2007 at 5:13

Attachments:

@playerversion asdoc tag should be 9.0 in source

All of the @playerversion AsDoc tags in the source specifies 8.5. I believe
this should be 9.0.

For example:

--
        /**
        *   Compares two arrays and returns a boolean indicating whether the arrays
        *   contain the same values at the same indexes.
        * 
        *   @param arr1 The first array that will be compared to the second.
        *
        *   @param arr2 The second array that will be compared to the first.
        *
        *   @return True if the arrays contains the same values at the same indexes.
            False if they do not.
        *
        *   @langversion ActionScript 3.0
        *   @playerversion Flash 8.5
        *   @tiptext
        */  
--

Original issue reported on code.google.com by mikechambers on 10 Jan 2007 at 7:44

DateUtil.parseW3CDTF - day is not parsed?

What steps will reproduce the problem?

var d:Date = DateUtil.parseW3CDTF("2007-07-25T16:12:00-06:00");
trace(d.day);

What is the expected output? What do you see instead?

expect 25, I always get 0 though.

What version of the product are you using? On what operating system?

0.90, on Windows XP


Original issue reported on code.google.com by [email protected] on 25 Jul 2007 at 5:35

[Question] Decodes a JSON string into a XML object.

My System:

Flex Builder 2.0.1
as3corelib version: Release version .90


Code: Decodes a JSON string into a Array object.
package
{

    import flash.display.Sprite;
    import com.adobe.serialization.json.JSON;
    import flash.xml.XMLDocument;
    public class JSonTest extends Sprite
    {
        public function JSonTest(){
          var object:Object=JSON.decode
('[{"title":"MTEnclosures","url":"http:www.ev123.com"}]');
          var xm:Array=(object as Array);
          trace("xm="+xm[0].title);
        }
    }
}
Code: Decodes a JSON string into a XML object.
package
{

    import flash.display.Sprite;
    import com.adobe.serialization.json.JSON;
    import flash.xml.XMLDocument;
    public class JSonTest extends Sprite
    {
        public function JSonTest(){
          var object:Object=JSON.decode
('[{"title":"MTEnclosures","url":"http:www.ev123.com"}]');
          var xm:XML=(object as XML);
          trace("xm="+xm);
        }
    }
}

Result: xm=null


Original issue reported on code.google.com by [email protected] on 30 Jan 2008 at 10:16

Allow PNGEncoder to accept metadata

Hi Folks, 

Thanks for this project first of all.  It's great.

I've had the need to add metadata to PNG images.  So I added optional, 
backward-compatible support for that in your PNGEncoder and the other 
PNGEnc (http://www.5etdemi.com/blog/archives/2006/12/as3-png-encoder-
faster-better/) which you might be merging with.

All the details are here:
http://blog.modp.com/2007/08/adding-metadata-to-actionscript-3-png.html

You can see how to extract metadata via the command line here:
http://blog.modp.com/2007/08/editing-png-metadata-from-command-line.html

If you need to me to write unit tests or anything, please let me know.

Comments welcome

thanks,

--nickg





Original issue reported on code.google.com by [email protected] on 20 Aug 2007 at 2:58

Implement SHA-256, SHA-224

SHA-1 and MD5 have each been cracked and are known to be weak hashing
algorithms.  With this in mind, and knowing that these algorithms will be
phased out by the NIST, we should implement the more secure SHA-256,
SHA-384, and SHA-512 algorithms in the crypto package.

The specification for the standards can be found here:
http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf

Original issue reported on code.google.com by darron.schall on 23 Jan 2007 at 11:43

Integrate ObjectTranslator into serialization package

Integrate the ObjectTranslator from
http://www.darronschall.com/weblog/archives/000247.cfm into the
serialization package.  This takes a generic object with properties and
turns it into a strongly typed class instance.  It works very well with
converting JSON data into Value Objects.

In the process of adding this to corelib, it would be a great enhancement
to make it recursive as well.

Original issue reported on code.google.com by darron.schall on 30 May 2007 at 2:49

Surce Download still has SVN info

What steps will reproduce the problem?
1. Download the source
2. Unzip and navigate to src directory
3. Note that the .svn folders and meta-info still exist

What is the expected output? What do you see instead?

 - To not see this info.  The source should be exported from SVN before
uploading here.


Original issue reported on code.google.com by [email protected] on 26 Jan 2007 at 8:38

WSSEUsernameToken: nonce incorrectly used to generate digest

What steps will reproduce the problem?
1. call WSSEUsernameToken.getUsernameToken("user", "password")

What is the expected output? What do you see instead?

In getUsernameToken, the nonce is base64-encoded. This encoded value is 
then used in determining the password digest. This is not according to the 
WS-Security UsernameToken specification: the password digest is based on 
the unencoded nonce value.

What version of the product are you using? On what operating system?

ad3corelib .90

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 12 Jul 2007 at 2:20

Need SHA 384 Class

We need to impliment a SHA 384 Class.

Original issue reported on code.google.com by mikechambers on 3 Mar 2007 at 9:06

URIError when URI component is not propertly UTF-8 encoded in URI class

What steps will reproduce the problem?

Add this code to URITest.as in corelib:

public function testUnescapingUnencodedChars() : void

            {

                  var s:String = "http://test.com/&&!%~ +=";

                  assertTrue(URI.unescapeChars(s) == s);

            }



What is the expected output? What do you see instead?

Brian comments: "The problem is in corelib's com.adobe.net.URI class. 
Specifically, URI.unescapeChars calls the global decodeURIComponent, which 
throws a URIError because the URI component is not properly UTF-8 encoded. 
A reasonable solution is to put the call to decodeURIComponent within a 
try-catch block and return the passed-in value if the call throws, perhaps 
parametrize this with a throwIfIllegal param, which the URI getters should 
set to false." 


What version of the product are you using? On what operating system?
corelib-90.zip, Windows XP

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 30 Jul 2007 at 11:56

Issue decoding JSON strings created from Javascript

Trying to deserialize following JSON string generated from javscript but
getting parsing error.
[{BookTitle:"JSON", Name:"Mat"}]

But folloing JSON string can be serialized successfully:
[{"BookTitle":"JSON", "Name":"Mat"}]


Original issue reported on code.google.com by [email protected] on 22 Feb 2007 at 4:29

DateUtil.parseW3CDTF has small bug with time of 00:00:00

What steps will reproduce the problem?
1. Call DateUtil.parseW3CDTF("2008-01-22T00:00:00Z")

What is the expected output? What do you see instead?
Result date is correct, but time is 7:00PM
Time should be 12:00 AM (midnight)


What version of the product are you using? On what operating system?
Not sure what version.  I grabbed from svn February 23, 2008.  Windows
Vista Business


Please provide any additional information below.
I fixed the issue, actually two issues, by modifying DateUtil.parseW3CDTF
to now look like the following.  I commented my changes.

First change is changing the order of looking for the offset and placing
Zulu last and the default.  This is because some Java libraries leaves off
the "Z" when no offset.

Second change is changing the way utc is calculated.  It gave the incorrect
result when time is midnight.  I changed to simply create a Date object and
let the Date object calculate utc instead of the code.

Here is the full parseW3CDTF method:
        public static function parseW3CDTF(str:String):Date
        {
            var finalDate:Date;
            try
            {
                var dateStr:String = str.substring(0, str.indexOf("T"));
                var timeStr:String = str.substring(str.indexOf("T")+1, str.length);
                var dateArr:Array = dateStr.split("-");
                var year:Number = Number(dateArr.shift());
                var month:Number = Number(dateArr.shift());
                var date:Number = Number(dateArr.shift());

                var multiplier:Number;
                var offsetHours:Number;
                var offsetMinutes:Number;
                var offsetStr:String;

                // Modified by Dale Bronk for SpectrumK12.  Changed order of finding
offset.
                // First check for "+", then "-", then assume "Z".  This covers the
instances
                // when "Z" is left off of the date string as some Java libraries will
not add
                // the "Z" when Zulu or no offset.
//              if (timeStr.indexOf("Z") != -1)
//              {
//                  multiplier = 1;
//                  offsetHours = 0;
//                  offsetMinutes = 0;
//                  timeStr = timeStr.replace("Z", "");
//              }
//              else if (timeStr.indexOf("+") != -1)
//              {
//                  multiplier = 1;
//                  offsetStr = timeStr.substring(timeStr.indexOf("+")+1, timeStr.length);
//                  offsetHours = Number(offsetStr.substring(0, offsetStr.indexOf(":")));
//                  offsetMinutes = Number(offsetStr.substring(offsetStr.indexOf(":")+1,
offsetStr.length));
//                  timeStr = timeStr.substring(0, timeStr.indexOf("+"));
//              }
//              // Modified by Dale Bronk for Spectrumk12.  Next line use to be
simply "else", now "else if..."
//              else if (timeStr.indexOf("-") != -1) // offset is -
//              {
//                  multiplier = -1;
//                  offsetStr = timeStr.substring(timeStr.indexOf("-")+1, timeStr.length);
//                  offsetHours = Number(offsetStr.substring(0, offsetStr.indexOf(":")));
//                  offsetMinutes = Number(offsetStr.substring(offsetStr.indexOf(":")+1,
offsetStr.length));
//                  timeStr = timeStr.substring(0, timeStr.indexOf("-"));
//              }
                if (timeStr.indexOf("+") != -1)
                {
                    multiplier = 1;
                    offsetStr = timeStr.substring(timeStr.indexOf("+")+1, timeStr.length);
                    offsetHours = Number(offsetStr.substring(0, offsetStr.indexOf(":")));
                    offsetMinutes = Number(offsetStr.substring(offsetStr.indexOf(":")+1,
offsetStr.length));
                    timeStr = timeStr.substring(0, timeStr.indexOf("+"));
                }
                else if (timeStr.indexOf("-") != -1)
                {
                    multiplier = -1;
                    offsetStr = timeStr.substring(timeStr.indexOf("-")+1, timeStr.length);
                    offsetHours = Number(offsetStr.substring(0, offsetStr.indexOf(":")));
                    offsetMinutes = Number(offsetStr.substring(offsetStr.indexOf(":")+1,
offsetStr.length));
                    timeStr = timeStr.substring(0, timeStr.indexOf("-"));
                }
                else // No offset, assume Zulu
                {
                    multiplier = 1;
                    offsetHours = 0;
                    offsetMinutes = 0;
                    timeStr = timeStr.replace("Z", "");
                }

                var timeArr:Array = timeStr.split(":");
                var hour:Number = Number(timeArr.shift());
                var minutes:Number = Number(timeArr.shift());
                var secondsArr:Array = (timeArr.length > 0) ?
String(timeArr.shift()).split(".") : null;
                var seconds:Number = (secondsArr != null && secondsArr.length > 0) ?
Number(secondsArr.shift()) : 0;
                var milliseconds:Number = (secondsArr != null && secondsArr.length > 0)
? Number(secondsArr.shift()) : 0;

                // Modified by Dale Bronk for Spectrumk12.  Instead of calculating utc,
I now create a Date and let the
                // Date object calculate utc.  This is because the the original
calculation of utc was giving an incorrect
                // result when the time was "00:00:00" which is midnight (12:00:00 AM). 
                finalDate = new Date(year, month, date, hour, minutes, seconds,
milliseconds);
                var utc : Number = finalDate.getTime();
                //var utc:Number = Date.UTC(year, month-1, date, hour, minutes,
seconds, milliseconds);

                var offset:Number = (((offsetHours * 3600000) + (offsetMinutes *
60000)) * multiplier);
                finalDate = new Date(utc - offset);

                if (finalDate.toString() == "Invalid Date")
                {
                    throw new Error("This date does not conform to W3CDTF.");
                }
            }
            catch (e:Error)
            {
                var eStr:String = "Unable to parse the string [" +str+ "] into a date. ";
                eStr += "The internal error was: " + e.toString();
                throw new Error(eStr);
            }
            return finalDate;
        }

Original issue reported on code.google.com by dbronk%[email protected] on 24 Feb 2008 at 4:19

Update SHA1 to work with Byte Data

Josh TynJala has updated the SHA1 to allow passing in Byte data (right now
the class only takes string).

http://www.zeuslabs.us/archives/113/enhancement-to-actionscript-3-sha-1-class/

We should look at integrated these changes into corelib.


Original issue reported on code.google.com by mikechambers on 10 Jan 2007 at 5:56

DateUtil.parseW3CDTF does not parse compliant dates

What steps will reproduce the problem?
1. DateUtil.parseW3CDTF("2007-07-31");


What is the expected output? What do you see instead?
Expected output should be a properly parsed Date object. Instead an error
is generated with the text "Error: This date does not conform to W3CDTF.".

What version of the product are you using? On what operating system?
as3corelib 0.9, windows vista

Please provide any additional information below.
According to the spec listed in the documentation, there are 6 acceptable
levels for W3CDTF - one being the "YYYY-MM-DD" format. See
http://www.w3.org/TR/NOTE-datetime.


Original issue reported on code.google.com by [email protected] on 31 Jul 2007 at 2:55

@playerversion asdoc tag should be 9.0 in source

All of the @playerversion AsDoc tags in the source specifies 8.5. I believe
this should be 9.0.

For example:

--
        /**
        *   Compares two arrays and returns a boolean indicating whether the arrays
        *   contain the same values at the same indexes.
        * 
        *   @param arr1 The first array that will be compared to the second.
        *
        *   @param arr2 The second array that will be compared to the first.
        *
        *   @return True if the arrays contains the same values at the same indexes.
            False if they do not.
        *
        *   @langversion ActionScript 3.0
        *   @playerversion Flash 8.5
        *   @tiptext
        */  
--

Original issue reported on code.google.com by mikechambers on 10 Jan 2007 at 7:46

Unable to Resolve "formatter" bundle

What steps will reproduce the problem?
1. Imported SWC
2. Imported the XMLUtils library
3.

What is the expected output? What do you see instead?
No errors. Two errors.

What version of the product are you using? On what operating system?
0.90. XP

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 22 Feb 2008 at 2:58

Enhancement: JSON deserializer shall take advantage of actionscript class typing

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.
JSON allows class hint and JSON deserializer shall allow users to request
returning object being strongly typed. Specifically, for example, when I
serialize a java object from server side, I could specify a corresponding
actionscript 3 class to use. Then on the client side I could get this
object instead of a generic object. When JSON serializer serializes an
actionscript object, the actionscript class shall also appear as a class hint.

Thank you very much!

Melvin 
[email protected]

Original issue reported on code.google.com by [email protected] on 13 Jul 2007 at 4:31

WSSEUsernameToken creates incorrect timestamp

What steps will reproduce the problem?
1. invoke WSSEUsernameToken.getUsernameToken("user", "password");

What is the expected output? What do you see instead?

The resulting string contains a string representation the date/time when 
the function was called. The timezone of that string representation is Z 
(for UTC), but the time itself is in local time.

What version of the product are you using? On what operating system?
as3corelib .90

Please provide any additional information below.

Suggested fix is to use DateUtil#toW3CDTF instead of the DateFormatter.

Original issue reported on code.google.com by [email protected] on 12 Jul 2007 at 1:14

JSON does not encode XML instances into anything useful

What steps will reproduce the problem?
1. trace( JSON.encode( <test attr1="test" attr2="42"><child1
childAttr1="false" /></test> ) );

What is the expected output? What do you see instead?

Like Date instance (see issue #2), there is no standard XML encoding syntax
defined for JSON.  Because E4X is a core part of ECMAScript Edition 4, I
would suspect that the JSON-encoded XML would just use <> like an XML literal.

So, the above trace would produce the following JSON string:

"<test attr1=\"test\" attr2=\"42\"><child1 childAttr1=\"false\" /></test>"

Along the same lines, the following:

  var arr:Arary = new Array();
  arr.push( <test /> );
  arr.push( true );
  trace( JSON.encode( arr ) );

... should probably output:  "[<test/>,true]"

The current output is {}, which is clearly not good, no matter what the
expected output should be.

Please use labels and text to provide additional information.

There needs to be a consensus on what the expected output should be before
this is addressed.  

This could spring into a religious debate, "Why on earth would anyone want
to encode XML in JSON?  It's apples and oranges!"... but rather than get
into politics, I'd rather just agree on a universal solution / standard for
dealing with XML instances in JSON encoding.

Original issue reported on code.google.com by darron.schall on 29 Dec 2006 at 9:02

Unit tests fails when timezone is not US-Pacific

The following unit tests are currently failing:

testParseW3CDTF
testParseW3CDTFWithMilliseconds
testParseRFC822

The reason that they're failing is because I'm running the test harness in
Eastern time, when the author wrotes the tests in Pacific time.  The Date
object returned by the parse methods is correct, but the "hours" property
is not the same because the timezone offset factors into that value.

To fix, the hours comparison needs to factor in the time zone offset to
avoid erroneous test failures.

Original issue reported on code.google.com by darron.schall on 15 Jan 2007 at 9:11

parseW3CDTF and parseRFC822 should not accept dates that aren't formatted correctly

What steps will reproduce the problem?
1. use parseRFC822 to parse a date whose month is not 2 digits
ex) DateUtil.parseRFC822(2007-1-243T04:00:00Z)

Similar cases for year, date, hour, etc. and also for parseW3CDTF 

What is the expected output? What do you see instead?
Expected:  error Actual: the dates are being accepted

What version of the product are you using? On what operating system?
Windows XP

Please provide any additional information below.
Attached is a Flex app that demonstrates the problem.  This was originally
found in Philo

Original issue reported on code.google.com by [email protected] on 25 Jan 2007 at 10:50

Attachments:

Need to add SHA512 Class

Need to add SHA512 Class

Original issue reported on code.google.com by mikechambers on 3 Mar 2007 at 9:06

JSON cannot decode Infinity or -Infinity

<b>What steps will reproduce the problem?</b>

<i>1.</i> trace(JSON.decode(Infinity));   <i>or</i>
<i>2.</i> trace(JSON.decode(-Infinity));

<b>What is the expected output? What do you see instead?</b>

<i>Expected output would be the same as the input:</i> Infinity <i>or</i>
-Infinity.

<i>Infinity error:</i>

Error: Unexpected I encountered
    at com.adobe.serialization.json::JSONTokenizer/parseError()
    at com.adobe.serialization.json::JSONTokenizer/getNextToken()
    at com.adobe.serialization.json::JSONDecoder/::nextToken()
    at com.adobe.serialization.json::JSONDecoder$iinit()
    at com.adobe.serialization.json::JSON$/decode()
    at json_test_fla::MainTimeline/json_test_fla::frame1()

<i>-Infinity error:</i>

Error: Expecting a digit
    at com.adobe.serialization.json::JSONTokenizer/parseError()
    at com.adobe.serialization.json::JSONTokenizer/::readNumber()
    at com.adobe.serialization.json::JSONTokenizer/getNextToken()
    at com.adobe.serialization.json::JSONDecoder/::nextToken()
    at com.adobe.serialization.json::JSONDecoder$iinit()
    at com.adobe.serialization.json::JSON$/decode()
    at json_test_fla::MainTimeline/json_test_fla::frame1()

<b>What version of the product are you using? On what operating system?</b>

<i>Latest download. Windows XP, Flash CS3.</i>


Original issue reported on code.google.com by [email protected] on 17 Aug 2007 at 12:06

JSON.decode(&quot;&quot;) throws a TypeError due to null pointer dereference; would be better to throw a JSONParseError

What steps will reproduce the problem?
1. Execute this: JSON.decode("")

What is the expected output? What do you see instead?

The actual output is this exception:

TypeError: Error #1009: Cannot access a property or method of a null object
reference.
    at com.adobe.serialization.json::JSONDecoder/::parseValue()

I'm pretty sure "" is not legal JSON, so it is correct to throw an
exception, but it would be better to throw a JSONParseError, so that users
who are anticipating possibly illegal JSON can write their code like this,
and have it catch the error:

try {
  JSON.decode(blahblah);
} catch (e:JSONParseError) {
  // deal with it
}

The way to fix this is, I think, to change JSONDecoder.parseValue() so that
at the top of the function, before "switch (token.type)", add this code:

  if (token == null)
    tokenizer.parseError("Unexpected end of input");

What version of the product are you using? On what operating system?
.90, on Windows

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 27 Mar 2007 at 6:05

JSON doesn't recognize UINT (0x123456) as a number

What steps will reproduce the problem?
1. Create a json string that contains a key:val like {"myNumber":0xFF1100}
2.
3.

What is the expected output? What do you see instead?
Should get the value (16716032), but parser throws an error "Unexpected 'x'
encountered'

What version of the product are you using? On what operating system?
corelib v.9

Please provide any additional information below.
I have provided a fix (lines 340-352, 538-547) in JSONTokenizer.as. See
attached.

Original issue reported on code.google.com by [email protected] on 18 Sep 2007 at 11:13

Attachments:

Add UnitTest for JPGEncoder class

We need to add a unit test for the JPGEncoder class:

com.adobe.images.JPGEncoder

Original issue reported on code.google.com by mikechambers on 10 Jan 2007 at 8:27

Allow for decoding of non-quoted object identifier strings in a non-strict decode mode

What steps will reproduce the problem?
1. private var string: String = '[[{metadata:{fields:
[{width:50,attrname:"NME_NIVEL_FORM",fieldtype:"string"},
{width:4,attrname:"ANO_FORM",fieldtype:"string"}]},rowdata:
[["Doutorado","2006"]],version:2.0}]]';

2. var obj: Object = JSON.decode(string);

3. Error: Unexpected m encountered: because metadata shoud be "metadata"

What is the expected output? What do you see instead?
I would like of one array:
private var array: Array =    [[{metadata:{fields:
[{width:50,attrname:"NME_NIVEL_FORM",fieldtype:"string"},
{width:4,attrname:"ANO_FORM",fieldtype:"string"}]},rowdata:
[["Doutorado","2006"]],version:2.0}]];

What version of the product are you using? On what operating system?
0.9



Original issue reported on code.google.com by [email protected] on 4 Sep 2007 at 12:50

Runtime Error

What steps will reproduce the problem?
1. Run program that uses JSON in Flex Developer.
2.
3.

What is the expected output? What do you see instead?
I expected to see a web page that looked like the one in the designer. 
Instead, I to the following output:
------------------------------------------------------------------------
TypeError: Error #1009: Cannot access a property or method of a null object
reference.
    at
com.adobe.serialization.json::JSONDecoder/com.adobe.serialization.json:JSONDecod
er::parseValue()[C:\Development\ContractProjects\Adobe\as3corelib\src\com\adobe\
serialization\json\JSONDecoder.as:197]
    at
com.adobe.serialization.json::JSONDecoder$iinit()[C:\Development\ContractProject
s\Adobe\as3corelib\src\com\adobe\serialization\json\JSONDecoder.as:64]
    at
com.adobe.serialization.json::JSON$/decode()[C:\Development\ContractProjects\Ado
be\as3corelib\src\com\adobe\serialization\json\JSON.as:81]
    at main/main::eventJSON()[/Users/hewij/Documents/Flex Builder
2/PHPJSON/main.as:24]
    at main/__eventRequest_result()[/Users/hewij/Documents/Flex Builder
2/PHPJSON/main.mxml:9]
    at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio
n()
    at flash.events::EventDispatcher/dispatchEvent()
    at
mx.rpc.http.mxml::HTTPService/http://www.adobe.com/2006/flex/mx/internal::dispat
chRpcEvent()[C:\dev\enterprise_bali\frameworks\mx\rpc\http\mxml\HTTPService.as:2
47]
    at
mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandle
r()[C:\dev\enterprise_bali\frameworks\mx\rpc\AbstractInvoker.as:168]
    at
mx.rpc::Responder/result()[C:\dev\enterprise_bali\frameworks\mx\rpc\Responder.as
:48]
    at
mx.rpc::AsyncRequest/acknowledge()[C:\dev\enterprise_bali\frameworks\mx\rpc\Asyn
cRequest.as:82]
    at
DirectHTTPChannel.as$139::DirectHTTPMessageResponder/completeHandler()[C:\dev\en
terprise_bali\frameworks\mx\messaging\channels\DirectHTTPChannel.as:359]
    at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio
n()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/flash.net:URLLoader::onComplete()
------------------------------------------------------------------------

What version of the product are you using? On what operating system?
The version of as3corelib is .90.  The version of Flex is 2.0.  My
operating system is a Mac.

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 20 Dec 2007 at 9:28

JSONDecoder needs to be more smart to parse

Description:-

JSONDecoder class needs to be more smart to decode strings like this:-

[ { "ew" : "wahan", "hws" : [ "caa","sss", ] }, { "ew" : "aap", "hws" : [
"ss", ] }, ]


You can see, there is extra comma (,) in array and individual objects. I
know above example is result of logical-problem in JSON serialization, I
find it quite common and even some of Google API do that.

I patched the code so that it works even such cases. I am attaching bothing
the patch and changed file.

Expected:-

JSONDecoder should be able to parse improperly terminated strings as shown
above. Those are quite regular use-cases.

Actual:-

It throws ParseError when it encounters ] or } after comma (,) in an array
or object.


Original issue reported on code.google.com by [email protected] on 29 Aug 2007 at 8:51

Attachments:

Consider integrating Patrick Mineault's PNGEncoder updates

Patrick Mineault made some changes to Tinic's original PNGEncoder, and
documented them here:

http://www.5etdemi.com/blog/archives/2006/12/as3-png-encoder-faster-better/

He doesn't mention what license the code is released under, so we'll need
to double check that we can integrate his changes.  We'll also want to
verify the updates before making any changes to the current version.

Original issue reported on code.google.com by darron.schall on 9 Jan 2007 at 3:16

JSON cannot encode/decode date instances correctly

What steps will reproduce the problem?
1. trace( JSON.encode( new Date() ) );

What is the expected output? What do you see instead?

The expected output, unfortunately, is not that well defined.  There is no
standard JSON syntax for dealing with dates.  A proposed standard is here:

http://www.nikhilk.net/DateSyntaxForJSON2.aspx

Essentially, serializing the date to "@number@" where number is the number
of milliseconds that have passed since Jan 1, 1970.

Either that, or we can use one of the ISO Date Standard formats.

The output from the trace statement is simply {}.  Clearly an empty object
is not good, not matter what the expected output should be.

Please use labels and text to provide additional information.

Whatever sort of serialization we implement should probably be specified
via a flag, passed to the static encode/decode methods.  Something like:

JSON.encode( date, JSON.DATE_FORMAT_ISO_8601 );
or
JSON.encode( date, JSON.DATE_FORMAT_AT_MILLIS_AT );

Also, a the decode routine should be specified so that string matching the
encoding format will be converted into true Date instances.

Original issue reported on code.google.com by darron.schall on 29 Dec 2006 at 8:44

JSON cannot encode class instance as String correctly

What steps will reproduce the problem?
1. Create a simple class, like the following:

public class ExampleClass
{
    public var prop1:String;
    public var prop2:int;
}

2. Attempt to get the jsonString from the class:

var instance:ExampleClass = new ExampleClass();
instance.prop1 = "test";
instance.prop2 = 42;
var jsonString:String = JSON.encode( instance );

3. Output the jsonString value:

trace( jsonString );  // "{}"

What is the expected output? What do you see instead?

The expected output is the following string:
{"prop1":"test","prop2":42}

Please use labels and text to provide additional information.

The problem lies in the objectToString() method in JSONEncoder.as,
specifically line 248:

   // loop over the keys in the object and add their converted
   // values to the string
   for ( var key:String in o ) {
   ...

That loop fails to iterate over the class members when o is a class instance.

The solution to the problem will need to use the describeType() method to
get the class meta data information, and then loop over that to create the
json string based on what the class members are.

Original issue reported on code.google.com by darron.schall on 29 Dec 2006 at 7:49

JSON doesn't decode with new lines

What steps will reproduce the problem?
1. Create a JSON String with new lines after commas and after braces
2. Try to decode it

What is the expected output? What do you see instead?
Error.


What version of the product are you using? On what operating system?
SVN - trunk

Original issue reported on code.google.com by [email protected] on 11 Jan 2007 at 5:25

DateUtilTest - incorrect test - testParseRFC822()

What steps will reproduce the problem?
1. run default testsuite;

What is the expected output? What do you see instead?
[FAIL] testParseRFC822 - com.adobe.utils::DateUtilTest
Error: d.date == 5 - expected true but was false

What version of the product are you using? On what operating system?
as3corelib 0.9, windows vista, timezone +0300

Please provide any additional information below.
Suggested fix is to use -

assertTrue("d.dateUTC == 5",d.dateUTC == 5);
assertTrue("d.monthUTC == 11", d.monthUTC == 11);
assertTrue("d.fullYearUTC == 2005", d.fullYearUTC == 2005);
// Fixes issue #12 - use UTC so time zone doesn't throw off hours
assertTrue("d.hoursUTC == 22", d.hoursUTC == 22 );
assertTrue("d.minutesUTC == 55", d.minutesUTC == 55);
assertTrue("d.secondsUTC == 43", d.secondsUTC == 43);

instead of the -

assertTrue("d.date == 5",d.date == 5);
assertTrue("d.month == 11", d.month == 11);
assertTrue("d.fullYear == 2005", d.fullYear == 2005);
// Fixes issue #12 - use UTC so time zone doesn't throw off hours
assertTrue("d.hoursUTC == 22", d.hoursUTC == 22 );
assertTrue("d.minutes == 55", d.minutes == 55);
assertTrue("d.seconds == 43", d.seconds == 43);



Original issue reported on code.google.com by [email protected] on 16 Oct 2007 at 8:31

Attachments:

JPGEncoder Poor Performance

What steps will reproduce the problem?
1. Initialize JPGEncoder (try various quality settings)
2. Encode
3. Track time spent encoding

What is the expected output? What do you see instead?
I would expect no more than a few seconds @ quality 70 for a 1MB x 1MB
picture (real imagery as opposed to cartoon or vector generated images)

What version of the product are you using? On what operating system?
.90, WinXP SP2

Please provide any additional information below.
Sample Image that took 21 seconds with image quality 70. (3.4 GHz Pentium
CPU, 1 GB RAM)
http://compression.ca/act/files/DSCN3974.jpg

Original issue reported on code.google.com by [email protected] on 7 Mar 2008 at 11:20

Add UnitTest for PNGEncoder class

We need to add a unit test for the PNGEncoder class:

com.adobe.images.PNGEncoder

Original issue reported on code.google.com by mikechambers on 10 Jan 2007 at 8:26

JSON example error

What steps will reproduce the problem?
1. attach source path
2. copy and paste JSON example in the download
3. Get error in Problems window: 1061: Call to a possibly undefined method
decode through a reference with static type Class.  JSON.mxml   JSON    line 14
April 26, 2007 1:27:25 AM   2231


What is the expected output? What do you see instead?
No errors, Errors

What version of the product are you using? On what operating system?
I don't know but I checked for updates on subversion

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 26 Apr 2007 at 6:40

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.