• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Haxe for Flash Platform developer
 

Haxe for Flash Platform developer

on

  • 7,198 views

Introduction to Haxe for Flash Platform developers

Introduction to Haxe for Flash Platform developers

Statistics

Views

Total Views
7,198
Views on SlideShare
5,280
Embed Views
1,918

Actions

Likes
0
Downloads
19
Comments
0

7 Embeds 1,918

http://matterhaxe.wordpress.com 1547
http://pigiuz.wordpress.com 169
http://www.scoop.it 115
http://www.whymca.org 80
http://lucamezzalira.com 4
http://translate.googleusercontent.com 2
https://www.google.fr 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Haxe for Flash Platform developer Haxe for Flash Platform developer Presentation Transcript

  • developersPIERGIORGIO NIERO & LUCA MEZZALIRA@matterhaxe
  • PG MEZZA
  • Flash, Javascript o ...
  • Haxe targets• Desktop App (C++, Neko, AIR...)• Web (JS, Flash, HTML)• Server Side (PHP, NodeJS, C#, Java...)• iOS• Android• Playbook
  • Roadmap Haxe• Attualmente è scaricabile Haxe 2.09 haxe 2.09 compilazione su ser ver + interactive debugging JS su Chrome e Firefox grazie al source mapping + haxe --dead-code-haxe 3:• Estate 2012 Haxe 3• Si sta già lavorando ad Haxe 4 con la rivoluzione di avere 1 unico linguaggio di programmazione per ogni target
  • Non è tutto oro quel che luccica• Implementazione Editor• DEBUGGER (!!!!!)• Integrazione “Adobbiana” verso i programmi grafici e non solo• DOCUMENTAZIONE (!!!!!)
  • Differenze Haxe vs AS3package org.matterhaxe; package org.matterhaxe {import nme.display.Sprite; import flash.display.Sprite; import nme.Lib; [SWF]class MyClass extends Sprite public class MyClass extends Sprite{ { private var myVar1: Bool; private var myVar1:Boolean private var myVar2:Int; protected var myVar2:int private var myVar3:Float;; internal var myVar3:Number inline public static var CIAO:String = "CIAO"; public static const CIAO:String = "CIAO"; public function new() public function MyClass() { { super(); // constructor } } function myMethod():Void private function myMethod1():void { { trace(CIAO); trace(CIAO) } } // static main function } public static function main() } { Lib.current.addChild( new MyClass() ); }}
  • Package & Classes package org.matterhaxe;import nme.display.Sprite;import nme.display.*; <<<< NOOO!!!!class MyClass extends Sprite, implementsIMyInterface
  • Access Modifier & Keywords - solo private e public- default è private- non cè const, cè solo var- cè inline per variabili e metodiinline static var CICCIO:String = "Ciao";
  • Basic Types - Void, Int, Bool, Float- Dynamic var ciccio: Dynamic = "Ciccio"; ciccio = 4; ciccio = new Ciccio();- Solo lettera maiuscola!!!
  • Constructor & Main Costruttore di classepublic function new() {}static public function main():Void { Lib.current.addChild(new MyClass);}
  • Type Parameters (generics & beyond) AS3:- Vector.<T>Haxe:- Built in: Array<T>, Vector<T>, Hash<T>- Custom: MyClass<T>- Type Constraints!!! MyClass<T: (ClassA,InterfaceB)>
  • Typedefs typedef MyType { var field1:Int; var field2:Bool;}var pippo: MyType = { 4, true };typedef Ugo = MyVeryVeryLongNamedClass;var ugo:Ugo = new Ugo();
  • Iterators for( i in 0...100){ trace(i);}for( i in myStringsArray){ trace(i);}custom: implementare i metodi del tipo"Iterator" nella classe       function hasNext() : Bool;     function next() : T;
  • Function Pointers AS3function myFunction (a:int,b:Number):void{}var myVar:Function = myFunction;Haxefunction myFunction(a:Int,b:Float):Void{};var myVar:Int->Float->Void = myFunction;
  • Cast Tom Cruise - MaverickKelly McGillis - CharlieVal Kilmer - IcemanAnthony Edwards - GooseTom Skerrit - ViperMichael Ironside - JesterJohn Stockwell - CougarBarry Tubb - Wolfman
  • Cast - safe casting:var car:Car = cast(vehicle,Car);- unsafe casting:var car:Car = cast vehicle;- Std casting:var toString = Std.string(10);var toNumber = Std.parseFloat("10");var toInteger = Std.int(10.1);
  • NME is a free, open-source framework thatenables development for iOS, Android, webOS,BlackBerry, Windows, Mac, Linux and FlashPlayer from a single codebase
  • file nmml di configurazione<?xml version="1.0" encoding="utf-8"?><project> <app title="HaXeList" main="HaXeList" package="" version="1.0.0" company="NME" ></app> <window width="320" height="480" fps="36" orientation="portrait" resizable="false"if="target_flash"/> <window width="320" height="480" fps="100" orientation="portrait" resizable="false"if="unless_flash"/> <set name="BUILD_DIR" value="Export" ></set> <classpath name="src"/> <haxelib name="nme"/> <assets path="Assets" rename="assets" include="*"/> <library path="assets/lib.swf" rename="assets/lib.swf" /> <ndll name="std" ></ndll> <ndll name="regexp" ></ndll> <ndll name="zlib" ></ndll> <ndll name="nme" haxelib="nme" ></ndll></project>
  • come compilare progetti NME nme test project.nmml iosnme test project.nmml ios -simulatornme test project.nmml androidnme test project.nmml webosnme test project.nmml blackberrynme test project.nmml windowsnme test project.nmml macnme test project.nmml linuxnme test project.nmml linux -64nme test project.nmml flashnme test project.nmml html5
  • How to install HAXE
  • IDE & Plugins• FDT 5• Textmate• Sublime Text 2• MonoDevelop• FlashDevelop 4• Intellij Idea• altri: http://haxe.org/com/ide
  • Haxe Books
  • Online references• haxe.org• haxenme.org• haxejs.org• nekovm.org• weblob.net• ncannasse.fr• haxelearning.wikispaces.com
  • [Teo] [eh...] CU & Aw: matterhaxe.wordpress.comt: @matterhaxee: matterhaxe@gmail.com