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.
First, setting it a property of the parent function, as is done in the "A" version of your script below. If you do this, the function is only usable after you give the definition.
Second, defining the function with the classical approach of "function functionName () { ... }". This definition undergoes "hoisting", which means the function becomes available throughout the parent object, i.e. even above the place it is defined. You can see this in the "B" version in the sample below, based on the original poster's code. Also on https://jsfiddle.net/dnL4j30u/
The output is
It works B (this works because the second definition gets hoisted)
It works A
It works B