problem about haxe-Collection of common programming errors
FlavorScape
syntax compiler-errors haxe openfl
I don’t think my syntax is actually bad here. Or is it? This is my first stab at OpenFL. The Haxe is not compiling correctly? Am I missing a compiler directive? Do I actually have a syntax error in this function? Syntax checker in Flashdevelop says no.Here’s the command: Running process: C:\Program Files (x86)\FlashDevelop\Tools\fdbuild\fdbuild.exe “C:\dev\Haxe\TestOpenFL\OpenFLTest.hxproj” -ipc 2e4ace78-45b9-4868-a2dd-cf2c35265f44 -version “3.0.0” -compiler “C:\HaxeToolkit\haxe” -library “C:\Pr
Luka Sverko
haxe dynamic-cast
Is it possible to cast a variable to another type based on information available at runtime?If I have:interface Foo { }class Bar implements Foo {public function new(){} }I want to do something like this (method is simplified for clarity):public static function dynamicCast<T : Foo>(target : Foo, cls : Class<T>) : T {var ret : T = cast(pTarget, cls);return ret; }I get the following compiler error:Unexpected )
Baelnorn
actionscript-3 haxe
First a little background: I’m looking for a way to create a “collection” library that abstracts the Flash Player version based implementation (Vector on FP10, Array on FP9) away from the calling code. I’ve already written a small AS3 lib doing that but……the performance is bad (especially because of two levels of indirection and the runtime type checks on the Array implementation) …the code is ugly (since Vector types need to be defined at compiletime I needed a factory returning concrete
simo
lambda haxe
I have a map variable:var bitmapDepths:Map<BitmapData, Int>;What I need is to remove all keys with value of 0, I tried this:bitmapDepths= Lambda.filter(Lambda.list(bitmapDepths.keys), function(v) { return (v > 0); });So, I used Lambda.list to iterate on bitmapDepths.keys inside Lambda, but I get this error:Void -> Iterator<flash.display.BitmapData> should be Iterable<Unknown<0>>I tried Lambda.array to iterate on bitmapDepths.keys, I got the same error, so who can ha
Voxl
flash actionscript-3 haxe
I am having some trouble figuring out how to overload a function in Flash using haXe. I know that Flash does not allow overloads but can accept function parameters without a type declared, but I am unsure as how to replicate this trick in haXe.EDIT: Since this does not appear to be possible, are there any known tricks that can be used to get around this limitation?
simo
haxe neko
I have started to use haxe to convert my action script 3 projects into NME, but, I like to know please what is neko in the world of linux? I searched for it, I found its an animated cat!Can any one please explain to me?
simo
actionscript-3 swf haxe
I am a new comer to Haxe, I was wondering about loading SWF files and using assets inside them. the following questions have no clear answer to me yet, they all about using assets from external swf files ( export for ActionScript, with a known Class name to use )If I am targeting HTML5, then how would I load a SWF file and use assets inside it? can I instantiate Classes inside the external SWF file? In general, will loading a SWF file and using assets inside it easy in Haxe? What about frames in
Will
flash actionscript-3 localization internationalization haxe
How do you make a Flash movie (using Haxe, or Actionscript code rather than the IDE) that supports multiple languages?Can you detect the browser’s language?Are there utility classes for managing the strings and selecting the appropriate one based on language?
codefx
compiler programming-languages llvm haxe hiphop
I have been thinking about source transformers like HipHop and Haxe. From their respective websites, I see that these tools converts a source language to target language and then uses the compilers of the target language to produce the final executable. The part that I find confusing is that how these tools deal with the case whether the source language is a memory managed laguage (PHP, Haxe lang) and the target language is a non-memory managed language(C / C++). I know that Mono adds a VM at co
John Conde
dart haxe
Does Dart aim to accomplish a lot of the same functionality as Haxe in terms of being able to target other languages and runtimes? Is it a stated or known goal of the language & tools?
almosnow
actionscript-3 function function-pointers anonymous-function haxe
I’m trying to differentiate anonymous functions like:function() { trace(“WOO”); }from the other ones (‘named’?) likevar _FUNC:Dynamic = function() { trace(“WOO”); }The reason I want to do that is because I can’t compare between two anonymous functions, because they are two different ones.To help me make things clearer, consider the following quick example.var _TEST:Dynamic = function(a:Dynamic):String {var _TESTA:Dynamic = function() { trace(“WOO”); };var _TESTB:Dynamic = _FUNC;return (a == _TES
xhunterko
haxe
I’ve had to move my stuff from a failing hard drive, so I’ve had to set up and reinstall everything again. And I’ve run into a couple problems.So I’ve got two errors here. The first error that I get is when I open flashdevelop to begin working. I get the error of:Can’t Find Haxelib.exeAnd of course, I’ve installed haxe and haxelib and everything else that’s needed pre-setup. However, when I run, the flash and html5 targets work fine regardless. I don’t know why that error shows up. Any ideas?My
Eldros
osx haxe
I wanted to do again to develop in haxe on my MacBook after quite a long time. So I go on haxe.org, download the mac installer and install the latest version of haxe with it.Then I open the terminal and type haxe, just to encounter this short error message:Bus ErrorWell, did I do something wrong? I’m using OSX 10.4, can it be that the latest version of haxe is not supported on this operating system?UPDATE:Looking into the system log, I found out that after the installer was called, the following
shadow_of__soul
android ios drag-and-drop touch haxe
i’m trying to make a simple drag and drop in haxe NME targeting touch devices, but i’m unable to.i tried, startDrag(), a combination of mouseDown, mouseUp and mouseMove,another combination of TouchEvent.TOUCH_BEGIN,TouchEvent.TOUCH_END,TouchEvent.TOUCH_MOVE and startDragTouch() etc.. but in the first 3 cases, the app crashes in androin, and in the last one, i’m getting:nme.display.Sprite has no field startTouchDragat the moment of compilation. Anyone knows a method to have drag & drop suppor
balazon
android flashdevelop haxe build-error nme
i’m just getting to know nme haxe developing, i’m currently using flashdevelop. I have a problem when building a sample app (piratepig) under android platform : lots of “no such file or directory”. Everything seems fine when i choose windows, html5, or flash platforms.Here’s the output:Running process: C:\Program Files (x86)\FlashDevelop\Tools\fdbuild\fdbuild.exe “C:\Users\Valentin\Desktop\PiratePig\Pirate Pig.hxproj” -ipc 2a666e48-3f38-4abd-b63a-25219cb72cf4 -version “2.10” -compiler “C:\Motion
Alvaro Fallas
android flashdevelop haxe nme
I’m trying to compile my nme project for android, but until this moment it has been impossible for me. The error message that I’m getting is Running process: C:\Program Files(x86)\FlashDevelop\Tools\fdbuild\fdbuild.exe”C:\Users\Andrés\Documents\myOP\project.hxproj” -ipccf7bbe3a-8e0c-47e5-aac3-4d442ae964f2 -version “2.10” -compiler”C:\Motion-Twin\Haxe” -notrace -library “C:\Program Files(x86)\FlashDevelop\Library” -target “android” Building project haxelibrun nme build “C:\Users\Andrés\Documents\
carboncopy
windows haxe
Im trying to use the windows api in haxe to create a windows application. I have already done this using ndlls and haxe/neko. I tried doing it with the cpp target where I embed c++ code into the haxe file using the new macro features in haxe 2.09. But, as soon as I include windows.h it gives an error./src/Main.cpp(79) : error C2039: ‘RegisterClassA’ : is not a member of ‘hx’./src/Main.cpp(81) : error C2660: ‘RegisterClassA’ : function does not take 9 argumentsCalled from ? line 1Called from Buil
Hammers
haxe
I am currently setting up a website using haxe targetting php and I’m having a problem with the haxe.Web.Dispatch library.Everything was working well until I tried to implement a doDefault() rule.I have the following rules in my dispatch api:doIndex(){ … }doPosts(){y:String, m:String, n:String){ … }And these will both redirect to the correct webpage. For example these both work fine:http://foo.com/index http://foo.com/posts/2013/01/post-titleAnd now I’ve implementeddoDefault() {…}in order
Lukasz Lew
actionscript-3 haxe
I’m thinking about using Haxe in place of AS3. What are the disadventages of that? I can think about:Difficulties with using native AS3 libraries. Difficulity of debugging after language translation. Haxe is quite young, it may have some rough edges. Does it?Does any one of you have expirience with Haxe dark sides?What are the adventages? I’ve heard:Performance. Multiple targets (But I don’t see how that is useful) Better typing that AS3 Maybe better syntax.Haxe is big enough that there should b
Shekhar
ios haxe nme hxcpp
For a client I’ve developed an iOS + Android app using Cordova (PhoneGap) for the user interface. Now, as an update to this app, I’m am attempting to add a game that was written in HaXe. Originally the game was written for the Flash target, but I’ve updated it to work with the C++ targets for Android and iOS.On Android it was easy to integrate this with the Cordova app using activities (the HaXe part runs as a separate activity), but I am having some trouble achieving a similar result on iOS.So
thedayturns
haxe nme
When I try to compile to cpp on OSX Lion with Haxe and NME, I get the following backtrace: […many lines above this one omitted…] Called from ? line 1 Called from BuildTool.hx line 1265 Called from BuildTool.hx line 554 Called from a C function Called from BuildTool.hx line 591 Called from BuildTool.hx line 710 Called from BuildTool.hx line 739 Called from BuildTool.hx line 153 Uncaught exception – Error creating pch: 256 – build cancelledHow can I fix this error?
jrouquie
flash haxe nme
I’m using Haxe and NME and the flash target to create a .swf. How do I make sure that uncaught Exceptions are shown? Currently it seems they are just silently eaten up. I’m compiling with:haxelib run nme build path/to/MyNmmlFile.nmml flashI believe it is some flag I need to pass there, or something I need to set in the nmml file, but don’t know what…
Areston
ios haxe nme
There are some problems when I tend to build my openfl project on cpp and ios with my Mac.The error message is showing below.Anyone who can help me?Thanks a lot!sh: g++: command not found Called from ? line 1 … Uncaught exception – Error creating pch: 127 – build cancelled
mattwallace
javascript compiler haxe
I am having an issue that I discussed on the haxe IRC channel but was unable to come up with a fixe. It seems to be a bug with the compiler.Here is the haxe codepackage; import js.Lib; import js.three.Three; import haxe.Timer;class Main { public var timer:Timer;public var renderer:WebGLRenderer;public var scene:Scene;public var camera:PerspectiveCamera;public function new() {timer = new Timer(30);var w = Lib.window.innerWidth;var h = Lib.window.innerHeight;scene = new Scene();// create a red
simo
flashdevelop haxe createjs
I have installed externs for createjs libraries:haxelib install createjsI added the createjs library to compile file:-main com.ketab.createjs_js_js.Main -cp src -lib createjs -js bin/m.jsAnd I can compile with no errors, but in chrome, I get this error:Uncaught ReferenceError: createjs is not defined for the line createjs.Ticker.useRAF = true;Here is my html file:<!DOCTYPE html> <html lang=”en”> <head><meta charset=”utf-8″/><title>createjs_js_js</title><met
César Alforde
javascript global-variables haxe
This question only applies to Haxe version < 2.10I’ve known about haxe for a while, but never really played with it until yesterday. Being curious, I decided to port showdown.js, a javascript port of markdown.pl, to haxe. This was pretty straightforward, and the javascript it generates seems to run fine (edit: If you want to see it in action, check it out here).However, I noticed that the generated code dumps a ton of stuff in the global namespace… and what’s worse, it does it by assigning
simo
user1107412
html5 flash haxe nme
I have tried to build an html5 canvas version of the nme-runnermark, but without any significant success. The flash version builds without any problems. I get the following stack of errors:/usr/lib/haxe/lib/nme/3,5,5/browser/utils/ByteArray.hx:22: characters 46-47 : Property initialization is not allowed /usr/lib/haxe/lib/nme/3,5,5/browser/utils/ByteArray.hx:24: characters 27-28 : Member variable initialization is not allowed outside of class constructor /usr/lib/haxe/lib/nme/3,5,5/browser/utils
Web site is in building