I imagine what is happening is that as soon as your swf's main class here (above) is created (right at initialization), the ENTER_FRAME event is binding the event listener to the button, but the button does not technically exist. Your methodology for initializing here is very bad practice but allow me explain how this all works.
Any time that you have a class that extends a type of DisplayObject, you should ALWAYS create a modified constructor designed to detect the "stage" element, and if it doesn't exist, listen for the ADDED_TO_STAGE event, and then perform your display-object based initializations within the callback. This is because display object based classes are kind of created in a half-assed way. The constructor is called immediately when the class is created/instantiated, but the properties and methods of that class, including children that are display objects (as in this case, buttons etc) are not available until the class has been added to the global "stage" object.
In the case of AIR, your NativeWindow object contains a single instance of "stage" that all children of that NativeWindow inherit. So when you add a MovieClip or a Sprite etc to the stage, the "stage" property of that display object is populated with a reference to the global stage object contained within NativeWindow. So always remember, when it comes to flash the practice with dealing with constructors/initialization of display objects is to delay all functionality to a callback that is processed only when the global "stage" has become available to reference. Below is an example using your code:
public class Main extends MovieClip {
public function Main():void
{
if(stage){
init();
}else{
this.addEventListener(Event.ADDED_TO_STAGE, init);
}
}
private function init(e:Event = null)
{
btnDialogCreate.addEventListener(MouseEvent.CLICK,CreateProject);
}
public function createProject(e:MouseEvent){
var directory:File=File.documentsDirectory;
directory.browseForDirectory("Directory of project");
}
}
Lastly I would highly recommend watching some of the free video tutorials on this site, as there are a wide range of subjects covered that will teach you much about flash.
http://gotoandlearn.com/