Re: [flexcoders] Randomizing Array (from actionscript cookbook3 and other places)
Alex: The error was actually in my next line of code however the debugger wasn't stopping at the right line. Silly me. The code works fine. Thanks, Patrick Yeah, the error was on the next On Mar 26, 2007, at 10:51 AM, Alex Harui wrote: This compiles and runs for me. private function init():void { function randomSort(a, b) { return Math.random().5 ? -1 : 1; } var numbers:Array = new Array(); for (var n:int=0;n10;n++){ numbers[n] = n; } numbers.sort(randomSort); trace(numbers); } From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of {reduxdj} Sent: Saturday, March 24, 2007 11:25 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Randomizing Array (from actionscript cookbook3 and other places) I am getting an error with the following code TypeError: Error #1006: value is not a function. at com.me.data::PictureProviderXML/::handleComplete() function randomSort(a, b) { return Math.random().5 ? -1 : 1; } var numbers:Array = new Array(); for (var n:int=0;nphotos.length;n++){ numbers[n] = n; } numbers.sort(randomSort); any ideas, it looks like I am using this properly any ideas? Thanks, Patrick
RE: [flexcoders] Randomizing Array (from actionscript cookbook3 and other places)
This compiles and runs for me. private function init():void { function randomSort(a, b) { return Math.random().5 ? -1 : 1; } var numbers:Array = new Array(); for (var n:int=0;n10;n++){ numbers[n] = n; } numbers.sort(randomSort); trace(numbers); } From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of {reduxdj} Sent: Saturday, March 24, 2007 11:25 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Randomizing Array (from actionscript cookbook3 and other places) I am getting an error with the following code TypeError: Error #1006: value is not a function. at com.me.data::PictureProviderXML/::handleComplete() function randomSort(a, b) { return Math.random().5 ? -1 : 1; } var numbers:Array = new Array(); for (var n:int=0;nphotos.length;n++){ numbers[n] = n; } numbers.sort(randomSort); any ideas, it looks like I am using this properly any ideas? Thanks, Patrick
RE: [flexcoders] Randomizing Array (from actionscript cookbook3 and other places)
What makes you think that that error is coming from that code? What is your handleComplete() method? And aren't you getting a line number telling you the exact line in which value is not a function? - Gordon From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of {reduxdj} Sent: Saturday, March 24, 2007 11:25 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Randomizing Array (from actionscript cookbook3 and other places) I am getting an error with the following code TypeError: Error #1006: value is not a function. at com.me.data::PictureProviderXML/::handleComplete() function randomSort(a, b) { return Math.random().5 ? -1 : 1; } var numbers:Array = new Array(); for (var n:int=0;nphotos.length;n++){ numbers[n] = n; } numbers.sort(randomSort); any ideas, it looks like I am using this properly any ideas? Thanks, Patrick
[flexcoders] Randomizing Array (from actionscript cookbook3 and other places)
I am getting an error with the following code TypeError: Error #1006: value is not a function. at com.me.data::PictureProviderXML/::handleComplete() function randomSort(a, b) { return Math.random().5 ? -1 : 1; } var numbers:Array = new Array(); for (var n:int=0;nphotos.length;n++){ numbers[n] = n; } numbers.sort(randomSort); any ideas, it looks like I am using this properly any ideas? Thanks, Patrick