Define Document Class with out using Properties Panel

Is there some way to not use the properties panel to define the Document class?

Here is my situation:

My goal was to create a class that would remove the default ContextMenuItems and add my own. I was having trouble accessing the stage.

I turn this example code into a class and imported it in my fla.
http://livedocs.adobe.com/livecycle/es/sdkHelp/common/langref/flash/ui/ContextMenuBuiltInItems.html#includeExamplesSummary

However when I would import the class it would not change the whole stages context menu.

I then defined it as the Document class using the Properties panel and it worked fine. I would really like to know how to define the document class using code and not the interface.