RE: [flexcoders] Re: Flexbuilder 2B1: coercion error at package declaration, JSON
Yes, a for..in loop will return the properties as strings, you'll want to use a regular for loop (for (var i:int=0; i someArray.length; i++) if you want the int access. Matt -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of dhirshbe Sent: Friday, February 24, 2006 2:14 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Flexbuilder 2B1: coercion error at package declaration, JSON Thanks, it was somewhere else in the file. I wasn't aware that arrays still had string indices. The error was: for(var i:int in someArray) --- In flexcoders@yahoogroups.com, Matt Chotin [EMAIL PROTECTED] wrote: I think there must be another problem in your file and the compiler just can't line it up correctly. Can you break the file down further and see what happens? I'm assuming you did this in an AS file and not MXML? As for JSON I don't think anyone has tried it yet. Matt -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of dhirshbe Sent: Thursday, February 23, 2006 3:25 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Flexbuilder 2B1: coercion error at package declaration, JSON When I try to compile with -strict, I get the error: Implicit coercion of a value of type 'String' to an unrelated type 'int' The line it refers to reads package packagename { Any ideas? Also: Is there a convenient way to create objects from JSON in AS3? -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] Re: Flexbuilder 2B1: coercion error at package declaration, JSON
Hi, It is probably not worth doing this now. As Darrel pointed out on this thread somewhere there is an AS3 library for JSON coming out soon. -David From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Doug LowderSent: Friday, February 24, 2006 5:57 PMTo: flexcoders@yahoogroups.comSubject: [flexcoders] Re: Flexbuilder 2B1: coercion error at package declaration, JSON Regarding JSON, have you tried the parser at http://www.theorganization.net/work/jos/JSON.as to see if it will compile in AS3? Since the eval() function has been removed, I think parsing is the only approach left.Doug--- In flexcoders@yahoogroups.com, "dhirshbe" [EMAIL PROTECTED] wrote: Thanks, it was somewhere else in the file. I wasn't aware that arrays still had string indices. The error was: for(var i:int in someArray)--- In flexcoders@yahoogroups.com, "Matt Chotin" mchotin@ wrote: I think there must be another problem in your file and the compiler just can't line it up correctly. Can you break the file down further and see what happens? I'm assuming you did this in an AS file and not MXML? As for JSON I don't think anyone has tried it yet. Matt-Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of dhirshbe Sent: Thursday, February 23, 2006 3:25 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Flexbuilder 2B1: coercion error at package declaration, JSONWhen I try to compile with -strict, I get the error: Implicit coercion of a value of type 'String' to an unrelated type 'int' The line it refers to reads "package packagename {" Any ideas?Also: Is there a convenient way to create objects from JSON in AS3? -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.