I am trying to call the function MyMethod from within a object but none of the syntax below works. There must be a really obvious error below but I can\'t see it.
I'm pretty sure you can define methods anywhere in the file, even after you call them, but they way you are defining the method is the flaw.
http://ejohn.org/apps/learn/#5
Notice that if you define a variable with an anonymous function as it's value then you are not able to call the function by name (because it doesn't have one). Instead you should name it using the convention
function nameOfTheFunction( arguments ) {
...
}
I found the following link will to be very useful:
http://www.dustindiaz.com/javascript-function-declaration-ambiguity/