You're confusing methods with global variables. There's only one global here:
Code:
function TomTom:SetClosestWaypoint(...)
end
function TomTom:AddMFWaypoint(...)
end
function TomTom:AddZWaypoint(...)
end
Those method names -- AddMFWaypoint, AddZWaypoint, SetClosestWaypoint -- are not global variables. They're not local variables, either. They're table keys. Another way to visualize the situation would be like this:
Code:
TomTom = {
SetClosestWaypoint = function(TomTom, ...)
end,
SetMFWaypoint = function(TomTom, ...)
end,
SetZWaypoint = function(TomTom, ...)
end,
}
This falls under the heading of "your addon's main object" -- in TomTom's case, its main object is a table, and is accessible via the global variable "TomTom". Everything else in your addon -- methods, other frames, font strings, textures, etc. -- should either be strictly local (if you don't need to access them outside of the file where they're defined) or added to your main frame/table (the "frame.text" in my previous post) so it can be accessed through the main object.