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);
}
}
//Can be private or public, doesn't matter private is better practice
private function init(e:Event = null)
{
//Notice the function paramter has a default value assigned of null. This is required so we can call this function without args as in the constructor
//Also the flag variable is not necessary because this function is called once
btnDialogCreate.addEventListener(MouseEvent.CLICK,CreateProject);
}
//Also it is generally considered bad practice to put capitals on the start of your function/variable names. Generally only classes are named this way ie: Main.
public function createProject(e:MouseEvent){
//You do not need a try/catch statement for simply opening a file browser dialogue. This is a native method you're invoking with a native, predefined default directories inside the VM. Flash is already doing this for you
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/