Get field names through a function

Get field names through a function

Is there a way to get the field names through a function?  For instance you can use getFieldNames(); to determine the names of the fields in the current form, but what if I want to get the field names if I'm not in a form?

So can I use something like the following:

  1. frmEvent.getFieldNames()
I appreciate the help.

Leo