If you want all your code on the main timeline, and your button exists on the first frame, than on frame 1 you can add:
this.myButton.addEventListener("click",myFunction);
function myFunction()
{
//whatever code you want to run when you click the button
}
if the button is added to the stage on a different frame from the one where the rest of your code is stored, for example you have all your code on frame 1, but the button isn't added to the stage until frame 3, then you need to put your function inside a global variable, otherwise it won't be accesible from other frames or from inside movieclips. That would looke like this:
//on frame 1
myFunction = function()
{
//whatever code you want to run when the button is clicked
}
//on frame 3 when the button is added to the stage
this.myButton.addEventListener("click",myFunction);
putting the function inside a global variable is also how you would make it accessible to code that is inside a symbol rather than on the main timeline.
As to your other question about running your exported project without internet access. If you go to File > Publish Settings and then switch to the HTML/JS tab at the top, uncheck Hosted Libraries. Now when you publish your project it will include a local copy of the createJS javascript library and your project should run without an active internet connection, assuming you haven't linked to any other remote files in your code. You may need an active internet connection the first time you publish after unchecking Hosted Libraries, I'm not certain if Animate downloads a new copy of the createJS library when you uncheck Hosted Libraries, or if it has a local copy that is added when you install the program.
Hope this helps!