[Flashcoders] RE:Flashcoders] Extending Array Question

2006-04-18 Thread azsl1326-email
Thanks, that will work. So there is no definitive way to add the values all at once, i.e. [1,4,5,76,3] when extending an Array? Thanks again. Ian Thomasn wrote: Hi there (whoever you are!) Your problem is that the [1,2,3] initialiser syntax is actually a short cut for creating a new Array()

Re: [Flashcoders] RE:Flashcoders] Extending Array Question

2006-04-18 Thread Robert Leisle
You could also do: var myArray:ArrayExtension = new ArrayExtension(); myArray.push(Hello, Goodbye, World); same result as doing them separately. [EMAIL PROTECTED] wrote: Thanks, that will work. So there is no definitive way to add the values all at once, i.e. [1,4,5,76,3] when extending

Re: [Flashcoders] RE:Flashcoders] Extending Array Question

2006-04-18 Thread Mike Britton
class com.ArrayExtension extends Array { public function ArrayExtension() { super() var argString = arguments[0].split(,); for(var i=0; i argString.length; i++) push(argString[i]); } } Usage: var arEx = new ArrayExtension(one,two,three);

Re: [Flashcoders] RE:Flashcoders] Extending Array Question

2006-04-18 Thread Fumio Nonaka
Another solution: // ActionScript 2.0 Class Definition: com/ArrayExtension.as dynamic class com.ArrayExtension extends Array { function ArrayExtension() { if (arguments.length == 1 !isNaN(arguments[0])) { this.length = arguments[0];