11-03-05 01:45 AM
I'm not sure what you're trying to do (what is answer? is it a method?).
Have you tried function.apply?
var answer:Array =3D new Array("john", "sally", "frank");
function somefunction(id)
{
return answer[id];
}
var somevar =3D function() { return somefunction.apply(this, arguments)
; }
trace(somevar(0));
Just a stab in the dark, but this code works.
Hth,
On 11/2/05, Johnny Zen <johnnyzen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> Hi all
>
> I've come across a strange problem.
>
> This code:
>
> var cl_id =3D so.data.order[i];
>
> var somevar =3D somefunction(cl_id)
>
>
> function somefunction(id) {
>
> returns answer(id)
>
> }
>
> When I run the code, the function returns undefined, but if I flag the
> function in debugger, it works?
>
> Any ideas?
>
>
> Johnny
>
> -----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> -----------------------------------------------------------
>
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
--
John Grden - Blitz
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
[ Post a follow-up to this message ]
|