var myWoker:Worker = new Worker('myHaxeJSScript.js');
I dont know how to do it in Haxe.
onmessage = function(e){ var t = e.data; postMessage( "Greetings from the worker script! (Your main script said:"+t+")" ); }
com.tamina.Test.onmessage = function() { ... }
Any idea ?
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
package com.tamina.planetwars.data;import js.Dom;import js.Lib;
/** * ... * @author d.mouton */
class AsbtractPlayer {
public function new() { } public static function __init__():Void{ untyped __js__("onmessage = com.tamina.planetwars.data.AsbtractPlayer.prototype.onmessage"); } public function onmessage(message:Dynamic):Void { var t:Dynamic = message.data; postMessage("message du worker : " + t); } public function postMessage(message:Dynamic):Void { } }
onmessage = com.tamina.planetwars.data.AsbtractPlayer.prototype.onmessage;
com.tamina.planetwars.data.AsbtractPlayer = function() {
};
com.tamina.planetwars.data.AsbtractPlayer.__name__ = true;
com.tamina.planetwars.data.AsbtractPlayer.prototype = {
postMessage: function(message) {
}
,onmessage: function(message) {
var t = message.data;
this.postMessage("message du worker : " + Std.string(t));
}
,__class__: com.tamina.planetwars.data.AsbtractPlayer
}
--
new MyWorkerScript().export(); can't work with public inline static function exportI'm trying to replace my implementation by yours and it doesn't work anymore.
As a matter of fact, I didn t have time to test it :p
But removing "inline" on "export" may work ;)