Abusing functions

in Macromedia’s help files and API they constantly use the notation

somefunction(param1 [, param2])

to indicate that param1 is a necessary parameter, but param2 is optional. This is kinda reminiscent of the dot notation from lisp, but i can’t find any information on proper actionscript syntax to declare optional parameters, and the compiler keeps yelling at me whenever i try any variant of a function definition with square brackets in it. is this effect actually accomplished by somehow overloading the function?

also, how can you access an objects members if you have the variable name as a string? as in, I know the function’s name is “grab” or whatever, but I can’t actually code obj.grab into the actionscript, i need to use the “grab” string. how do i do that?