You're right Kenneth.

var g:Vector.<uint> = Vector.<uint>([1,2,3,4,5]);
var hh:Vector.<uint> = g.slice();
var h:Vector.<uint> = g.map(mapper);
var a = 5;
function mapper(item:uint,ind:uint,g:Vector.<uint>):Vector.<uint>{
        trace(g[ind]+30);
        return g;
}

In this case, hh returns 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://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 mapper(item:uint,ind:uint,g:Vector.<uint>):void{
>       trace(g[ind]+30);
> }
>
> Hope that helps,
> - Michael M.
>
>
>
> -----Original Message-----
> From: flashcoders-boun...@chattyfig.figleaf.com 
> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kenneth 
> Kawamoto
> Sent: Thursday, August 18, 2011 9:27 AM
> To: Flash Coders List
> Subject: [Flashcoders] Vector.map()
>
> Dear coders,
>
> Vector.map() is supposed to return a new Vector but it appears to return
> nothing (undefined). Is this working for you?

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to