Intro To haXe Development With FDT

From FDT Documentation

(Difference between revisions)
Jump to: navigation, search
(Using the FDT HaXe Plugin)
(Compiling and Viewing your .SWF)
Line 5: Line 5:
= <center>Video</center> =
= <center>Video</center> =
{{#widget:Vimeo|id=42348465|width=600|height=400}}
{{#widget:Vimeo|id=42348465|width=600|height=400}}
-
 
-
= Compiling and Viewing your .SWF  =
 
-
 
-
== Adding HaXe Code  ==
 
-
 
-
The syntax of haXe is a bit beyond the scope of this tutorial - but that doesn't mean we have to code something boring! Copy and paste the code below to make a simple animation [[Image:Img preview.png|Img preview.png]]. Or type in the the code yourself to begin exploring the syntax auto completion FDT provides.<br>
 
-
 
-
<br> <source lang="actionscript">
 
-
 
-
package ;
 
-
import flash.display.Sprite;
 
-
import flash.events.Event;
 
-
 
-
class Main{
 
-
static var view:Sprite;
 
-
static var x: Float = 0;
 
-
static var y: Float = 200;
 
-
static var speed :Float = 20;
 
-
static var max_x : Float = 550;
 
-
 
-
    static function main() {
 
-
new Main();   
 
-
    }
 
-
 
-
    function new(){
 
-
    view = new Sprite();
 
-
    flash.Lib.current.addChild (view);
 
-
    flash.Lib.current.stage.addEventListener(Event.ENTER_FRAME, update_view);
 
-
    }
 
-
 
-
    function update_view (e: Dynamic){
 
-
    view.graphics.clear();
 
-
    view.graphics.beginFill(0xff0000, 1);
 
-
    view.graphics.drawCircle(x, y, 50);
 
-
 
-
    if(is_invalid_x()) speed  = speed * -1;
 
-
    x+= speed;
 
-
    }
 
-
 
-
    function  is_invalid_x() : Bool {
 
-
    return x > max_x || x < 0;
 
-
    }
 
-
}
 
-
 
-
</source>
 
-
 
-
== Compiling HaXe  ==
 
-
 
-
For the time being, FDT will automatically attempt to compile your .SWF every time you save it. If there are no errors in your project, your .SWF will appear in your ''project&nbsp;''older. If it doesn't appear, try refreshing your project.
 
-
 
-
== View Your SWF  ==
 
-
 
-
You can view your SWF with FDT by&nbsp;selecting Run As &gt; SWF File. You can also use Ant Scripts with your HaXe Project&nbsp;but for more in depth know-how on using Ant, check out the [[FDT and Ant Tutorial]].<br>
 
-
 
-
(Note: ''If you get an error while tying to run the Ant file, it's probably a JRE error, check out the [[FDT and Ant Tutorial]] to learn how to correct it.)''
 
= Wrap Up  =
= Wrap Up  =

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

Wrap Up

That's it, you've successfully set up your first FDT haXe Flash project!

As this plugin is still a beta release, please bare with us! For any feedback, feature requests, improvements, bugs and other issues we encourage you to use PowerFlasher JIRA site, our community driven tracking website, to make the haXe support in FDT the greatest ever.

Get FDT5