Blog Haxe, NME, openFL, Flash, HTML5 and mobiles posts and experiments en Thu Oct 30 00:00:00 2014 Thu Oct 30 00:00:00 2014 Haxe / Neko / Tora Demoscene Memories

Making backup of my HD, I came across this old stuff from my demoscene years as 8bits graphician.
Many memories from this time, I've passed so much nights painting on Grafx2, a Deluxe Paint (Amiga) clone working on PC.
At this time, the challenge was to have the most beautiful picture using just 256 colors max.
I was a fan of some artists as M4de (from Bomb demoscene team), Lazur (from Pulse PL), Yoga, Dzordan, X-man (who is actually one of the coder of Grafx II) and some others, that I'm sorry but I forgot...

You can say, it's not really linked with what I'm doing now for years, but in fact the demoscene world taught me a lot : I was impressed by these raw coders and graphicians that fought with optimization of their routines or pixels, just to fit in minimum size, which todays is forgotten because of the large amout of space we have and the performances of the CPU's...
Let's see some of my humble contributions

2014-10-30 00:00:00
Work in progress Many monthes I have not posted anything on my blog...
The main reason is that I was really busy with all the stuff I worked on.

Some of the work was personal, that I try to develop and maintain on my free time, like a Haxe website engine, a kind of Haxe CMS, some tools that help me in my daily workflow production, some Haxe contributions...

But I worked also on some new and interesting projects, like a client-server software to send SMS using a GSM modem...

Let's see more in details what I'm writing about

2014-10-20 00:00:00
Templotar : CastleDB localization CastleDB is a static database written wy Nicolas Cannasse that uses a JSON file to store data and comes with a Haxe library and a simple editor.

You can store different kind of data and retrieve them in the Haxe context, CastleDB comes also with some magic macro, but I use it here simply to store some static texts that I use for my templates and manage language localization.

And to manage all that, from templating with templo for example to translation, here's a little tool, as usual .

2014-03-24 00:00:00
FBuilder a tool to help working with multiple targets It's a bit hard to manage a project with multiple targets.
For example if you write a website, you'll work with some source code for the server's app, the javascript and/or Flash, some CSS, maybe some template files and then... All that is not really homogeneous.
I work with FlashDevelop which is a good Windows's IDE and even it supports all Haxe's plateforms, it doesn't manage multiple targets.
So I wrote a light tool to help me working with all that, using Haxe, Neko, SWHX and HScript.
Basically, it displays buttons for the targets defined in your xml project file and when clicked, it runs the defined script (written in hscript of course...)
It's also another example of using SWHX

2014-03-19 00:00:00
Custom macro haxe.xml.Proxy completion I use haxe.xml.Proxy for a long time now in order to manage my texts when I write a website.
You can see a good post about it here.
It says if you have an xml file in your project which looks like that for example :

<?xml version="1.0" encoding="utf-8" ?>
	<t id="wrongLogin"><![CDATA[Wrong login or password]]></t>
	<t id="invalidData"><![CDATA[Invalid data]]></t>

And this magic class in your project :

import haxe.ds.StringMap;

class MyTexts extends haxe.xml.Proxy<"bin/texts.xml", String> {
	public static var all	= new StringMap<String>();
	public static var list	= new MyTexts( all.get );

Then you get compiler auto-completion for your strings stored in the xml file like that :

MyTexts.list.	// Here you get propositions for : "wrongLogin" or "invalidData"
2014-03-04 17:43:19
Haxite : writing an entire website using haxe All you need to easily write an entire efficient website is in the standard haxe library : a routing system with the haxe.web.Dispatch class, a template system with the haxe.Template class, an ORM system with the sys.db.Object and sys.db.Manager classes.
Here I've written a draft of a website using all that, but instead of using the haxe.Template class, I'll use the Templo library, that you can easily find through haxelib.
To this combo Dispatcher/Templo/SPOD I added here the use of HSS to generate the output CSS, DBAdmin lib to generate and manage database and I use the haxe.xml.Proxy magic class to manage my texts (the website is multilanguage...)
This code can be compiled for the nekoVM or the PHP target.
At the end, I've done some benchmarks to test different kind of outputs : mod_php, mod_neko (use of cacheModule or not), mod_tora (use of database session system or the memory shared Tora's system)

2013-10-28 11:22:14
Chat example with Tora Queue in comet-style and Protocol The Tora server offers the possibility to share persistant data between different modules running on it. The tora.Share class is used to share the data.
Knowing how it works, it can be used with an kind of event system that trigger a notification when a shared data is modified.
That's where Tora's Queue and Protocol are useful.
I've written a quick and light example of chat, one using the tora.Queue class and the comet-style communication with javascript, and another on Flash using the tora.Protocol class and a direct Flash-Tora connection.

2013-10-28 01:16:12
Neko cacheModule and Tora Share Using the Apache's module mod_neko (or mod_tora), you can use the neko.Web.cacheModule function to cache all the statics initialisations that occur during the module's boot that is executed just once, at the first request and then is cached into memory for the future requests.
You can for example cache all the website configuration, the texts, the templates.
It works fine, and makes often the website more responsive, but there are things to keep in mind some things

2013-10-27 21:45:23
Haxe javascript-neko IDE For now about 8 years, I work with Flash Devleop which is, IMHO the best editor for Flash and Haxe projects on Windows (I haven't tried another ones because I never needed to use another technology than Haxe since about 2006 )
I'm personally satisfied with Flash Develop but it runs only on Windows and yesterday, I read a thread on the Haxe mailing list about the next Haxe IDE in plan and, havning heard Nicolas Cannasse talking about a Javascript IDE some mothes ago in a meeting, I couldn't resist to give a try to a HTML-Javascript-CSS-NekoVM Haxe IDE.

2013-09-29 20:05:38
HTML font with border using FontForge

Here comes an alternative to get a font with a border in HTML without using text-shadow CSS property neither -webkit-text-stroke or another text processing as sifr (using flash...)
I also remember using this process in order to get font's border on Flash Player 7 and less, in the past, before the comming of Flash Player 8 with its filters.

Text borderText border
Check this out !Check this out !
2013-09-02 18:11:10
Signals, Haxe macros inline dispatch and my turtle "Fabienne" I never liked events...
I'm not writing about events that my friends organized and where many naked girls under narcotics did weird things with their anatomy, no.

2013-06-19 20:37:55
FlashDevelop Start Page plugin

I hate the FlashDevelop Start Page that opens sometimes I don't know when and why...
In fact it's all my fault. There is a well done settings panel where you can customize many things and especially the Start Page, but I haven't really taken time to look at this quitely, I have not time...
All that to say that some days ago I've seen that there are some kind of extra methods allowed for the browser engine like displaying the last FD release version, create a new project or open a project...This last gave me an idea .

2013-06-16 11:23:57
Haxe extern keyword and modular applications I have often worked on huge applications, which need to be explosed into modules. It permits, in particular, to maintain easily the whole applications, working on separated modules that can share a common core base.
The thing is also not to duplicate code, neither in the source or in the generated output.
And for now more than 6 years that I work with Haxe, I use the famous extern keyword to achieve my goal.
Things change, and Haxe 3 comming soon, there are new semantics on extern classes which forbid some useful things that were permitted using Haxe 2.10 or less.
But as the fashion is on macros nowadays, and as it says :"There's a macros for that !", let's see how to get the same behaviour as before using Haxe 3.

2012-12-19 00:00:00
Flash, Haxe, NME, SWHX - Web, Desktop, Mobile : Everywhere, do what you want !

I come back again with an old stuff...
All that began when looking at my incredible website ( ), I rememebered that the menu, on the top right of the page, was written for the Flash plateform. And I know that nowdays, to be up-to-date, you have to work with HTML5 !
Ok, no problem for me... As the title of the post suggest : I work with Haxe and I can do what I want !

2012-12-05 00:00:00
BloHx : From Flash to NME to Windows/ OSX/ Linux/ Android/ iOS/ Blackberry/ HTML5...

Long time ago I rewrote in Haxe a little game called Blocky
I wrote this game quickly as a sample for an old lib I used to write and some mothes ago I decided to rewrite again this ununderstandable () game, first to update it for the last haxe's version, still targeting only Flash and then using NME to target Windows, OSX, Linux, Android, iOS, Blackberry, HTML5...That's enough for now
Let's see how to make an existing Haxe Flash game working as a native desktop or mobile device's application or export it in HTML5 for any browser.

2012-11-23 00:00:00
Haxe 3 : Get ready Since the Haxe 2.10 RC on June 2012, you can test some new features that will be implemented in the next Haxe 3.0 release that should come on December on January 2013. Maybe for Christmas ?
In order to follow all changes and become more familiar with the new features I work with Haxe Nightly Builds. Let see how does it look like and how start form now using Haxe 3 new features.

2012-10-31 00:00:00
Simple socket cross-domain policies Neko server In a previous post it was question about Flash Player security and we've seen that we need a cross-domain policies server in order to connect a socket on another domain.
We gonna see how to quickly write this kind of server using Neko, that is one of Haxe's "server side" plateform. It means that common Haxe "client-side" developers as flash, javascript or NME developers can easily write their servers using the same language. Quite a good thing, isn't it ?

2012-10-28 00:00:00
Flash Player security and application domains summary

This post will try to help you to understand what's going on behind the scene inside the Flash Player when playing with loading and sharing external data or connecting remote servers. It's a summary of differents security strategies and architechtural cases that can be applied to a project.

2012-10-12 00:00:00
Haxe & NME Collections Benchmark In order to test which type of collection I should use in differents cases, I wrote a simple little benchmark that can be used both on Flash or all NME targets. Here comes my personal results (ms)

2012-10-06 00:00:00
Qu'est ce que NME ?

Dans la continuité de la philosophie de Haxe, qui se veut être un langage universel web et avec l'avènement de nouvelles plateformes de développement comme les mobiles (iOS, android, webOS, BlackBerry...) et le HTML5, il est apparu un autre O.V.N.I appelé NME. Voici une brève présentation de ce nouvel outil...qui n'est d'ailleurs pas si "nouvel" que ça .

2012-08-21 09:37:00
Qu'est ce que Haxe ? Pour tous ceux qui se demandent encore ce qu'est Haxe, voici une introduction succincte à cet O.V.N.I autant décrié que méconnu !

2012-08-20 16:07:00
« using » en Haxe Dans la version 2.04 de Haxe, qui devrait pointer son nez d'ici peu, un nouveau mot clé apparaîtra : using
Ce mot-clé est différent des autres langages comme le C++ ou C# par exemple. C'est un raccourci du compilateur pour cibler des méthodes statiques comme des méthodes d'instance...Un petit truc pour le confort du développeur
Voyons voir ce que ça veut dire tout ce bordel...

2009-05-24 11:48:21
Haxe completion for Flash Develop 3

Flash develop 3 supports Haxe projects now.As many IDEs, FD3 has his own completion system that helps you writing code in a specified language, and for now it's Haxe language case too.
Here comes a patch for FD3 that allows Haxe compiler's built-in completion.
Let's see how install it and how it works.

2009-03-30 19:46:45
FEffects 1.1.1 I've changed a little bit the FEffects Tween class so you can use now, the short syntax that allows working directly on an object's property and you can set the easing function in the constructor.
Some new methods like : pause(), resume(), seek( n : Int ) and reverse() are added, and the following getters : position, duration, isPlaying and reversed.
The main loop function is inlined now too.

Original post is here
You can also see this post about sharing code between different plateforms (FEffects do that ).

2009-02-25 19:28:32
Flash desktop applications using Haxe &amp; SWHX

In March, I had a proposition to write an article on Haxe for a magazine called "Flash&Flex Developer's Magazine". It is a quarterly publication distributed in English language in the USA.
It was much work for me, because Haxe is a vast subject and it was very difficult to choice what talking about !
Finally, I've written a desktop application, and then I decided to tittle the article :"Flash Desktop applications using Haxe & SWHX"
The application is an Icon-Dock (a la Object-Dock, YZDock...) entirelly build with Haxe.
Since I can't publish the article (13 pages effective of pure eye's pleasure :D ) on my blog, until the magazine is in stores, here is the source code of the dock called "FDock"...of course ;).

2008-11-09 20:02:45
Haxe articles updated for Haxe 2.0

Some monthes ago, I released 2 articles for The Flash&Flex Developper's magazine.
Since Haxe 2.0, some changes occured, so here comes new versions of the FDock application described in the first number and XiLib example for the 2nd.

2008-11-02 22:01:56
FSlideShow Here is a light slide show flash movie, written in Haxe of course and targeting Flash Player 9.
I haven't any good picture to display, so I asked some friends of mine, to give me some of their lost pixels. Thanks guys
Click on the picture you like, to see the author's blog.

2008-08-28 23:38:09
hxDeploy : Haxe project template When I used to work with the Flash IDE, it was easy to test a piece of actionscript code, in an empty flash project. It was build somewhere in a temporary folder, and I never cared about that.
Since I don't use the the Flash IDE anymore, and in order to do quickly a test, I have to open my favourite editor, create a project, create the folders, files...A boring work...
And at the end what you get is an "experiments" folder, where there is a million of subfolders begining by "test"...
I've written something to deploy quickly a Haxe project. It's nothing exciting but it can help.

2008-08-25 21:37:43
hjs : Writing hScript in &lt;script&gt; HTML tag You can't sleep since hScript is released ?! You want write hScript everywhere and even your last greeting card was written in hScript?!
Nothing special here...
I've tried to write some hScript directly inside a <script> tag in the HTML document, as we can use javascript or vbscript and else ...
Take a look at that, it's just funny .

2008-08-09 02:53:05
Haxe 2.0 RC1 The new Haxe verison is available !

2008-08-04 16:41:29
hScript Some days ago, Nicolas Cannasse has released a new library called hScript, for Haxe.
This lib enables you to "interpret some code dynamically".
hScript is really powerful, you can try it with this little hScript Interpreter.

2008-07-24 14:02:43
XiLib for Haxe XiLib is a package of 2 classes, that can help in building modular Flash applications.
It facilites application's maintenance : There is no need to re-build the whole project to fix a specific bug, to upgrade an existing part or add a new part to an existing application.
Xilib works with Haxe Flash9 and gives help in loading and using ressources from external SWF libraries (as run-time downloaded classes, media assets, components, plugins or listeners*).
Let's see how does it work

2008-06-16 18:23:35
Unified Flash 6 - Flash 10 Loader Here comes a sample of an universal loader that can load flash movies from version 6 to flash 9 or higher.
In fact, the problem is not really the version number of the flash movie but of the ActionScript Virtual Machine (AVM) used. Flash applications using ActionScript 1/2 (flash <=8) work with AVM1 and these using ActionScript 3 (flash 9-10) work with AVM2, and both are not compatible.
AVM2 have instances of AVM1 and you can load flash<=8  applications into a flash 9 or flash10 but you cannot load flash 9 or 10 into flash <=8 movies... I don't know if it's really clear...
Anyway, it's a flash 6 universal loader with progress event and flashvars, that can load and execute flash 9 or 10 applications.

2008-05-28 16:42:44
Haxe New Way to Dock ! I'm proud, to present the cover of the next Flash&Flex Developer's magazine !

2008-05-13 14:40:37
Same source code for different plateforms using Haxe - Flash / JavaScript component sample You can find many frameworks or libraries, plateform dependant, that help you writing your applications. You can, for exemple, find UI components, motion tweens libraries for flash (like caurinaTweener) and for JavaScript (like JavaScript Motion Tween). Each plateform is different and each library has its own API, that you have to learn and sometimes it's the best way to give you reason for hanging .
Of course you can write your own libraries that use the same API for the different plateforms you target, but as everyone should know, coders are lazy.
Haxe targets Flash and JavaScript, and thanks to the conditional compilation, you can easily build libraries having the same API and behaviour on different plateforms and sharing same, common source code.
Here comes an little example of a Button component having the same appearence and  behaviour on Flash9 and JavaScript. 70% of the source code is common for both plateforms... Less time spent on building and debugging our library. It's a great news since time is money, and we don't want to loose money, right?

2008-04-19 12:38:27
FEffects 0.1.0 for Haxe (Tween for Flash8, Flash9 and JS) This is a little package that I wanted to create including some tweens, sine loops effects (will come soon) and others effects that change values in time.
For now, a Tween class and easing equations (ported to Haxe), are available for flash8, Flash9 and JavaScript.
Here is a sample :
Chips :

2008-04-13 02:26:43
Haxe/PHP : Nouvelle plateforme pour Haxe Aujourd'hui, a été publié ce post, par Franco Ponticelli, annonçant la sortie de la version alpha 1 de ce projet. Haxe cible désormais le PHP...en gros : t'écris en Haxe et ça te pond du php nickel derrière.
J'ai craqué. J'ai fais le petit "Hello World" qui suit.
C'était dans l'ordre des choses...

2008-04-11 20:35:00
Sexy, light mp3 player

I've written a little mp3 player using SWFMill and Haxe.
3 params available:

  • file : mp3's URL
  • text : caption
  • loop : 'true' or 'false'

Noting new here, let see the sources.

2007-12-22 22:14:12
Using AS3 project from Haxe as library asset This post is an extension of this one talking about flex in haxe without external loading.
When you want to use a SWF made with the Adobe Flash 9 or with the free mxmlc compiler, you have several ways in Haxe.
The easy one is to load this SWF as external data. And then working with the .hx header classes generated from the AS3 project.
But if we want have only one SWF output file, we have to "merge" the 2 projects.
Here come a weired way to do that but it's the only one I've found

2007-12-21 13:38:52
Haxe / JavaScript Test Shoot'em up 100 lignes de code

Je suis un bricoleur en javascript mais Haxe m'a donné envie d'essayer de faire quelque chose d'un peu propre.
J'ai donc fait un petit jeu tres rudimentaire et simple à base de HTML, CSS et JavaScript (ecrit en Haxe ).
On peut voir le jeu ici.

2007-12-02 22:54:15
AIRLogger for Haxe AIRLogger is a useful standalone tracer (like LuminicTracer - Flash Inspector i.e.) targeting SWF and running on the Adobe Integrated Runtime.
The console is written by Cedric Nehemie (aka Abe -an abstract friend of mine ).

Here you can find the Haxe API for it.

2007-08-17 08:57:30
Using Flex components in Haxe with SWFMill and without external loading - part 1 Haxessibility & Flexibility ! :D
We can work with Flex components in Haxe using an external loading as we can see in Haxe website tutorial:
The post following is a first attempt to use Flex components in Haxe without external loading. (Merging SWF at compilation).

2007-08-16 08:00:45
Using Flex 3 Component without MXML - only AS3 This post is a complement to an old post Mon premier SWF9 gratos avec Flex SDK (in french).
When using MXML, a lot of initializations are made in background (Application, UIComponent ...)
This post is a sample AS3 code without any MXML that enables you using Flex Component in pure AS3, initializing manually Flex Application.

2007-08-11 13:44:37
Luminic Tracer Flash Inspector 0.25 - 0.30 Haxe (flash and flash9 compatible) For users of the usefull tracer by Pablo Costantini, Luminic Tracer Flash Inspector 0.25 (or 0.30), I've rewrited the class for Haxe, to use with SWF of course
It's an update from an old post.
Some bug fixed, light documentation added, and Haxe 1.14 compatible ! (new AS3 bytecode generation)

2007-08-09 21:03:05
Haxe Remoting : LocalConnection Haxe standard library, contains remoting package (haxe.remoting) to communicate between different plateforms (Server/JS/Flash).
LocalConnection is a way to communicate from SWF to another SWF.
Haxe includes a powerful remoting layer for the native Flash LocalConnection that is really easy to use !

2007-08-07 16:05:54
Ma première bibliothèque SWF gratos avec SWFMill

SWFMill est un petit programme gratuit, en ligne de commande qui permet de construire une bibliothèque d'objets (movieclips avec ou sans frames, sons MP3, images JPG, PNG, fonts) pour SWF.
Le programme prend en entrée un XML avec la description du SWF de sortie et notamment de la bibliothèque d'objets, avec leur nom de liaison. Le SWF ainsi obtenu peut être utilisé comme bibliothèque chargée à l'exécution ou lors de la compilation avec Flex ou Haxe, pour produire des SWF<=9.

2007-08-04 11:24:58
BloxHx 0.1 It's an open-sources Blocky clone game written in Haxe.

2007-08-04 11:19:55
Flex 3 + AIR SDK (beta1) for Haxe In order to access Adobe Flex or Adobe AIR APIs from Haxe, you need the externs classes.
These classes contain variables and methods signatures and ensure compile-time type checking (and completion...). They won't be compiled inside the SWF.
Then, you have to provide the used classes inside an extern SWF library (Flex components built inside SWF Library for example), or execute the application in the right flash player (AIR runtime for example).
If you attempt to use an object (class, function ...) that is not in the SWF library or is not native in the target flash player (AIR flash.filesystem API inside browser flash player), you'll get run-time exceptions.
You can download the ZIP that contains all the classes found in the Flex 3 SDK (excluding some standard libraries that are in the haxe std directory) here.

2007-07-28 23:08:32
Mon premier SWF9 gratos avec Flex SDK

Flex SDK est d'abord, comme son nom l'indique, un kit de développement. Il comprend, pour le plus gros, le framework de composants Flex et un compilateur MXML et AS3 gratuit. Flex SDK est inclus dans Flex Builder 2 ou 3 d'Adobe, qui est une solution payante de développement basée sur Eclipse.

Autrement dit, voilà tout ce qu'il faut pour coder gratuitement des applications déstinées au Flash Player 9 et sa nouvelle machine virtuelle : l'AVM2

2007-07-27 15:01:17
Mon premier SWF9 gratos avec Haxe

Haxe est un nouveau langage universel orienté web. Sa syntaxe proche de l'actionscript / javascript permet de produire des applications client-serveur.
Côté server, la machine virtuelle nekoVM exécute du bytecode neko, produit par Haxe. Un mod_neko existe également pour Apache.
Côté client, Haxe produit un javascript (interprété par le navigateur) ou un SWF (exécuté par le flash player).
Haxe permet de produire du bytecode SWF (de la version 6 a 8) et du SWF9.
Voilà, encore un outil gratuit pour coder des applications destinées au Flash Player 9 et sa nouvelle machine virtuelle : l'AVM2

2007-07-27 15:00:54
Faire du Flash 9 gratos

On désigne par "Faire du Flash 9", le développement d'applications utilisant la machine virtuelle 2 du flash player 9. Pour rappel, le flash player est le visionneur de contenu multimédia et interactif le plus répandu sur les navigateurs, mais présent également dans les applications bureau grâce à AIR notamment ou ScreenWeaver. La version 9 embarque avec elle 2 machines virtuelles, la AVM1 exécutant du bytecode SWF3/8 et la AVM2 du bytecode SWF9, plus performante, notamment grâce à son typage fort. Le flash player exécute donc des fichiers SWF (swiff). Pour produire ces fichiers SWF, il y a l'éditeur officiel d'Adobe (IDE) Flash CS3, Flex Builder2/3 mais également des outils gratuits et/ou open source : SWFMill, Flex SDK2/3, Haxe, OpenLaszlo, disponibles sur Windows, Mac OSX et Linux.

2007-07-25 11:40:18

Version : Alpha 9
Release date : 2007.06.02
I started writing a set of skinnable components for Haxe targeting flash8 and flash9.
I'll stop that once AsWing will be ported to Haxe.

2007-06-15 21:07:53
SWFMill + Flash 9 Library This is a quick post about how to use SWFMill.
There are some tricks to generate SWF Library for Flash 9.

2007-05-23 12:52:34
What's Haxe, Neko and SWHX ? For all people who thinks that Haxe is another toy turning around big Flash world, this post will try to show its importance...

2007-05-13 21:45:01
Flash Inspector 0.25 Haxe (flash and flash9 compatible) For users of the usefull tracer by Pablo Costantini, Flash Inspector 0.25, I've rewrited the class for Haxe, to use with SWF of course.

2007-05-13 21:43:57
Haxe Completion I will try to explain quickly, what's going on :
Your favourite IDE often provides you auto completion depending on the language you're writing your code. To do that, the plug-in reproduce a part of the compiler job ; it's a kind of parser, so it can suggest you what the compiler is waiting for in the next chars you'll write ( often after a "." or a "(" ).

2007-05-13 21:42:23