, and h still returns null.
- MM
-Original Message-
From: Kenneth Kawamoto [mailto:kennethkawam...@gmail.com]
Sent: Thursday, August 18, 2011 5:15 PM
To: Flash Coders List
Cc: Mendelsohn, Michael
Subject: Re: [Flashcoders] Vector.map()
What do you get for h?
Kenneth Kawamoto
http
the vector, and h still returns null.
- MM
-Original Message-
From: Kenneth Kawamoto [mailto:kennethkawam...@gmail.com]
Sent: Thursday, August 18, 2011 5:15 PM
To: Flash Coders List
Cc: Mendelsohn, Michael
Subject: Re: [Flashcoders] Vector.map()
What do you get for h?
Kenneth Kawamoto
http
element in g, you would return item * item.
Ernie
On 8/19/2011 9:00 AM, flashcoders-requ...@chattyfig.figleaf.com wrote:
Message: 3
Date: Fri, 19 Aug 2011 08:36:30 -0400
From: Mendelsohn, Michaelmichael.mendels...@fmglobal.com
Subject: RE: [Flashcoders] Vector.map()
To: kennethkawam
, August 19, 2011 9:14 AM
To: Mendelsohn, Michael
Cc: kennethkawam...@gmail.com; Flash Coders List
Subject: Re: [Flashcoders] Vector.map()
private function arrayMapper(item:uint, index:uint, array:Array):uint {
return item + 30;
}
trace([1, 2, 3, 4, 5].map(arrayMapper));
// traces 31,32,33,34,35
Hi Kenneth...
This is working for me:
var g:Vector.uint = Vector.uint([1,2,3,4,5]);
var h:Vector.uint = g.map(mapper);
function mapper(item:uint,ind:uint,g:Vector.uint):void{
trace(g[ind]+30);
}
Hope that helps,
- Michael M.
-Original Message-
From:
What do you get for h?
Kenneth Kawamoto
http://www.materiaprima.co.uk/
On 18/08/2011 21:08, Mendelsohn, Michael wrote:
Hi Kenneth...
This is working for me:
var g:Vector.uint = Vector.uint([1,2,3,4,5]);
var h:Vector.uint = g.map(mapper);
function
6 matches
Mail list logo