Intro To haXe Development With FDT

From FDT Documentation

(Difference between revisions)
Jump to: navigation, search
(Wrap Up)
 
(146 intermediate revisions not shown)
Line 1: Line 1:
-
haXe is an open source and multiplatform programming language. To learn more and get the latest info on why using haXe and the platforms it targets, check out the [http://haxe.org/doc/intro haXe Introduciton].
+
= About FDT HaXe  Support=
-
=Installation=
+
HaXe is an open source and multiplatform programming language. Developed in collaboration with [http://www.powerflasher.com/ Powerflasher] and supported by [http://www.influxis.com/ Influxis], the FDT haXe plugin provides developers a powerful tool for authoring the haXe multi-platform language. Our goal is to provide the best haXe coding experience and that it feels like coding in the AS2, AS3 or MXML editor of [http://fdt.powerflasher.com/ FDT]: same shortcuts, same syntax coloring, same coding comfort. 
-
To get started with haXe, you'll need to download a few extra add-ons.
+
-
==Download haXe==
+
= <center>Video</center> =
-
 
+
{{#widget:Vimeo|id=42348465|width=600|height=400}}
-
Visit haXe's download page [001], and download one of the automatic installers for your platform.  For this example, we'll be installing haXe for OSX.
+
-
 
+
-
While installing, the installer may ask you to install '''Neko'''. Neko is a language / Virtual Machine platform that
+
-
Run the installer. Even if you never use Neko and haXe together, it may come in handy in the future and it's a small footprint to you're system [002].
+
-
+
-
When the installer is complete, confirm that the installation of haXe was successful by opening your console and executing the command '''haXe''':
+
-
 
+
-
<syntaxhighlight lang="bash">
+
-
haxe
+
-
</syntaxhighlight>
+
-
 
+
-
 
+
-
If installed correctly, the console should print out haXe info:
+
-
 
+
-
<syntaxhighlight lang="bash">
+
-
OSXs-MacBook:~ OSX$ haxe
+
-
haXe Compiler 2.06 - (c)2005-2010 Motion-Twin
+
-
Usage : haxe -main <class> [-swf9|-swf|-js|-neko|-php|-cpp|-as3] <output> [options]
+
-
Options :
+
-
  -cp <path> : add a directory to find source files
+
-
  -js <file> : compile code to JavaScript file
+
-
  -swf <file> : compile code to Flash SWF file
+
-
  -swf9 <file> : compile code to Flash9 SWF file
+
-
  -as3 <directory> : generate AS3 code into target directory
+
-
  -neko <file> : compile code to Neko Binary
+
-
  -php <directory> : generate PHP code into target directory
+
-
  -cpp <directory> : generate C++ code into target directory
+
-
  -xml <file> : generate XML types description
+
-
  -main <class> : select startup class
+
-
  -lib <library[:version]> : use a haxelib library
+
-
  -D <var> : define a conditional compilation flag
+
-
  -v : turn on verbose mode
+
-
  -debug : add debug informations to the compiled code
+
-
  -help  Display this list of options
+
-
  --help  Display this list of options
+
-
</syntaxhighlight>
+
-
 
+
-
 
+
-
If it doesn't - try restarting your computer or reinstalling it again.
+
-
 
+
-
==Install FDT's haXe Plugin==
+
-
Start up FDT 4 and select Help > Install new Software
+
-
Select the "FDT Plugins Site" update site. (If it is not included in your drop down menu, enter: http://fdt.powerflasher.com/plugins in the "Work with" text input and hit return)
+
-
 
+
-
Select "FDT haXe Plugin" from the plugin list, hit finish and follow the final installation steps.
+
-
 
+
-
=Setting up the haXe Plugin=
+
-
Before authoring and compiling haXe, you'll need to define the haXe SDK location for FDT to reference. Open FDT's preference widow and navigate to '''HaXe>SDK''' [005] and input the installation directory of haXe. If you're not sure where haXe is installed, the installation window will clue you in [006]. Here we can see that the installer is moving files and creating links to '''/usr/lib/haxe''' - this is the default location for OSX. After inputing the sdk location, hit '''OK''' [007].
+
-
 
+
-
=Create Your First haXe Project=
+
-
 
+
-
All haXe projects begin with the base of Flash Project that are converted to a haXe project. Begin by creating an '''Empty AS3 Project''' [008] and then create a new HaXe class by right clicking on '''src''' and choosing '''Other''' [010]. When the wizard pops up choose HaXe Class [011] and give the class the name '''Main''' and hit '''Finish''' [012].
+
-
 
+
-
==Convert Project To A haXe Project==
+
-
With your first class created, right click on the project and select '''Add HaXe Project Nature''' [013]. When this happens, FDT will ask you to input some project variables. We already have configured our '''HaXe SDK Location''' so just hit '''Next''' [014].
+
-
 
+
-
Let's leave the haXe configuration file to the default location but modify the '''Output Path''' to '''bin/Main.swf''' [015].  When completed, FDT will have created a few extra files and folders for us.  We don't need to worry about '''.hxtypes''' but we use '''project.hxml''' to set configurations to our project [016]. We can also see that FDT has begun to parse our project for syntax errors [017].
+
-
 
+
-
==Adjust Compiler Settings===
+
-
Before writing some code, let's alter some compiler options - this is done via the '''project.hxml''' file. Open us the file by double clicking on it [018] and then add this argument to the bottom:
+
-
 
+
-
<syntaxhighlight lang="bash">
+
-
swf-header 550:400:40:FF0000
+
-
</syntaxhighlight>
+
-
+
-
Right click the Project and select "Add HaXe Project Nature"
+
-
 
+
-
Click Next and set the Type to "Flash9 SWF", the output file to "bin/HelloHaxe.swf" and the Main Class to "HelloHaxe"
+
-
 
+
-
Extend Sprite and add the constructor and the static main function. The final class should look like this:
+
-
 
+
-
That's it, you've successfully set up your first FDT haXe Flash project! Start Coding Start adding code in the constructor for example:
+
-
 
+
-
Please note, the SWF is compiled on every Save, no specific launch configuration is available yet. This is our first Alpha release, please bare with us ! For any feedback, feature requests, improvements, bugs and other issues we encourage you to use our community driven tracking website to make the haXe support in FDT the greatest ever. We would also advice to subscribe to the haXe mailing list, it is a very active group with smart people and interesting topics. On the behalf of the FDT Team and Influxis, I hope you are as excited as we are and enjoy the first available version of the FDT haXe plugin, Michael Plank
+

Latest revision as of 16:33, 17 May 2012

About FDT HaXe Support

HaXe is an open source and multiplatform programming language. Developed in collaboration with Powerflasher and supported by Influxis, the FDT haXe plugin provides developers a powerful tool for authoring the haXe multi-platform language. Our goal is to provide the best haXe coding experience and that it feels like coding in the AS2, AS3 or MXML editor of FDT: same shortcuts, same syntax coloring, same coding comfort. 

Video

Get FDT5