Questions tagged [haxe]

1

votes
0

answer
135

Views

why “type not found” inside haxeflixel project, when i try to “import assets.manager.FileLoader;”?

i use haxeflixel and syntax import assets.manager.FileLoader; after this i have error 'type not found' my steps 1- terminal 'haxelib install assetsmanager' ... done 2- Project.xml 3- inside PS.hx 'import assets.manager.FileLoader;' third step create error . vscode terminal show me this > Executing...
lenivaya10001
1

votes
0

answer
176

Views

Why am I getting a null UStaticMeshComponent when using Unreal Haxe

I'm trying to use the following Haxe Unreal plugin. https://github.com/proletariatgames/unreal.hx My class seems to compile without error but when I try to create a UStaticMeshComponent using the FObjectInitializer I keep seeing a null value when I trace this in the console. Here is the Haxe Exter...
mattwallace
1

votes
0

answer
48

Views

How to section window in HaxeFlixel?

I'd like to partition the window into a number of sections. I want each section to have its own stuff going on, and sprites should not be able to leave the area. What is the idiomatic way to do this in HaxeFlixel?
Joshua Meyers
1

votes
1

answer
51

Views

How can I draw from ImageData to canvas with zoom in Haxe?

Well, I fill ScreenBuffer:ImageData 480x360 and then want to draw it to the canvas 960x720. The task is to decrease the fillrate; the nowadays pixels are very small and we can make them bigger with some quality loss. I look for the operator with 2D-accelaration. But we can't write directly to js.htm...
Mikhail Rudiuk
1

votes
2

answer
54

Views

Haxe DOMStringMap values not accessible

I'm trying to access the 'data-*' attributes on an element in the browser in Haxe. var element = document.getElementById('#someId'); var dataLabel = 'label'; //'data-label' element.dataset[dataLabel] = 5; That code (which works in plain javascript) generates two compilation errors in HaxeDevelop. 'S...
dmcblue
1

votes
1

answer
112

Views

How do I build AlphaTab?

I am trying to build + make changes to AlphaTab, a tablature reader that can be displayed on the web using SVG. It is a Visual Studio solution, but I cannot figure out how to build it successfully (I also have little experience with VS). I am using Visual Studio 2017 Enterprise, which I have access...
Kevin Wang
1

votes
0

answer
38

Views

Haxe + Webpack exporting empty object

I'm trying to run the webpack-dev-server on a JS exported by Haxe compiler. I'm using hxgenjs library to split the haxe output into separate modules and I'm trying to merge them by webpack (to use the hot module replacement functionality). Everything seems to be ok, but the output is empty object. T...
chalgoman
1

votes
1

answer
52

Views

How to convert Haxe Array/Vector to another type

Let's say I've got an array or vector of some parent type. To pass it to a function, I need it to be some child type (which I know beforehand that all elements are guaranteed to be all that child type). Is there a convenient way to do that? Right now I can only think to make a whole new array. Also...
loganjones16
1

votes
1

answer
430

Views

How to save an XML file on server with Haxe PHP?

I am just starting out with Haxe development, and wanted to give the PHP side a go, but am already a little confused. What is the best way to save some form data to XML files in a folder on a server with Haxe compiled to PHP?
Adam Harte
1

votes
1

answer
776

Views

Why do certain mouse events work in all browsers but Chrome?

I have some code that gets fired on these mouse events: button.addEventListener(MouseEvent.MOUSE_UP, function(e:MouseEvent) { ... button.addEventListener(MouseEvent.MOUSE_OVER, function(e:MouseEvent) { ... button.addEventListener(MouseEvent.MOUSE_OUT, function(e:MouseEvent) { ... They all work in al...
John Bachir
1

votes
1

answer
468

Views

Support for XNA WP7 and flash with existing C++ code base - pipeline, tools and approaches

all. We are game development company and we develop casual games for PC/MAC/iOS/Android with our own engine written in C++ (90-100%) and we are happy with it! Now we want to target XNA/WP7 and flash. What is the best way for doing this ? Of course we will have to rewrite some low-level stuff like sp...
Alexander K.
1

votes
2

answer
182

Views

What is the function of class ExprRequire in Haxe?

I am new to Haxe was trying to compile a .hx file. This file uses ExprRequire. Is this class deprecated from the latest versions? Everytime, I compile I get class not found ExprRequire. I do not also see any file name ExprRequire.hx at \haxe\std\haxe\macro with haxe versions 2.0.7 and 2.0.8. If thi...
Kshitiz Gupta
1

votes
2

answer
149

Views

Are the Flex API's needed to use Haxe with FDT5

I installed FDT5 and it gave me a warning about missing APIs. But at the FAQ it said the APIs weren't needed to use Haxe. Yet while trying to follow the Haxe FDT5 tutorial, it says to create a new FDT project. But FDT5 won't let me do this. It gives an error that the required SDK's aren't installed....
Hophat Abc
1

votes
1

answer
379

Views

FDT: Is there a good workflow to follow if I'm building Haxe / NME project with FDT

FDT is a great editor for Haxe as of the release of FDT 5.5, however I'm still learning the best workflows for compile and testing my project. There is a tone of buzz around using NME / NMML files to make it easier for cross platform compilation and testing. I found that when using sublime text 2...
mattwallace
1

votes
3

answer
704

Views

asynchronous exception handling in Haxe

What is best practice to handle exceptions in Haxe with asynchronous node.js? This code doesn't display 'haha: test', instead it displays 'test'. import js.Node; class Main { public static function handleRequest(req: NodeHttpServerReq, res: NodeHttpServerResp) { res.setHeader('Content-Type','text/pl...
Maximilian Ruta
1

votes
1

answer
744

Views

Calling Java functions from Haxe

I'm trying to call an external Java function from Haxe. How can I call a Java function that I've written from Haxe? Java code: public class ExternalClass{ public static String myFunction(){ //this will be invoked from Haxe return 'External Java function'; } } Haxe main class: class Main { public st...
Anderson Green
1

votes
1

answer
130

Views

Notifications of exceptions for haxe/nme/flash

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 flash I believe it is some flag I need to pass there, or somethin...
Mikael Lindqvist
1

votes
1

answer
367

Views

Using Haxe code in Java

Is there any way to use compiled Haxe code in a Java application (instead of vice-versa?) I want to write a library of functions in Haxe, compile the Haxe code to Java, and then use the compiled Haxe library in a Java application.
Anderson Green
1

votes
1

answer
490

Views

Haxe: Crash when build to android target

I am new to Haxe. Today I install it by reading the instructions in the http://www.haxenme.org; and download the 'Acurate Example'. I run the example with FalshDevelop, when I build it to flash(nme test 'Acurate Example.nmml' flash), it goes well! But when I use nme test 'Acurate Example.nmml' andro...
Rocky
1

votes
2

answer
243

Views

How do I create a macro for property extensions

I'd like to write my own macro for creating property like objects in Haxe. This question is not so much about properties but more about writing macros. (probably NME has already a macro for that). having this class in haxe class Foo { @:property var bar:String; } I like this to be expanded into clas...
robkuz
1

votes
2

answer
291

Views

Humble Haxe, approaches to automating merging haxe within a non haxe friendly target project?

Often with haxe we need to use existing non haxe code, so instead of writing externals we may want our haxe code to absorb parts of a system or add to it, a system where we can't assume a nice haxe setup. For instance taking the js target suppose we want to add functionality to some existing javascr...
Justinfront
1

votes
1

answer
204

Views

Using ASWing Haxe version to target android

I just checked out the Haxe version from http://svn.aswing.org/aswing/trunk/haXeAsWing/ And copied the org folder next to com folder of my project, if I target flash player in FlashDevelop, it will compile with no errors, but if I target android, I get those errors: org/aswing/AWTextField.hx:58: lin...
simo
1

votes
1

answer
1.8k

Views

Uncaught ReferenceError: createjs is not defined

I have installed externs for createjs libraries: haxelib install createjs I added the createjs library to compile file: -main com.ketab.createjs_js_js.Main -cp src -lib createjs -js bin/m.js And I can compile with no errors, but in chrome, I get this error: Uncaught ReferenceError: createjs is not d...
simo
1

votes
1

answer
108

Views

Why my sql comment parsing EReg expression not compile?

I have an sql querying tool that is written in Haxe and im trying to add some sql comment support to the code. Currently if a user has any comments (single line or multi line) the query fails on the server side. Thus, im trying to write a simple method that takes the sql the user inputs and replaces...
sWARm
1

votes
1

answer
269

Views

write a REPL: where to start?

I learned Ruby and Scala, and they both have a great REPLs. The interactive tools help me a lot when learning a language. Recently I'm learning Haxe and found it doesn't have a real REPL(just a crippled shell language). My ultimate goal is to make a REPL for Haxe. But I know it takes a lot of work t...
Lai Yu-Hsuan
1

votes
1

answer
601

Views

drag and drop for html5 in NME project

I am using haxe, nme and flashdevelop. I am trying to convert a flex project to html5. I have a few circles drawn by code on stage. In as3 we can usually add individual eventlisteners to each of the objects (in for loop) and can use the startdrag, stopdrag methods for dragging objects. This works f...
sharmacal
1

votes
1

answer
321

Views

Unable to get default working with haxe.Web.Dispatch

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...
Hammers
1

votes
1

answer
1.6k

Views

haxe/flash: Camera.getCamera() by name returns null

Preliminary note: I use haxe for writing and compiling the code. The case is as follows: I have up to four cameras on the same machine and I need to capture them individually. flash.media.Camera.getCamera() takes a name and I guess it's the name of the camera I want to target. I take the names from...
thgie
1

votes
1

answer
764

Views

Haxe/OpenFL: How do I override GameActivity.java

Is there a way to override parts of an OpenFL-Template without modifying the installed version? Specifically I want to modify templates/android/src/org/haxe/nme/GameActivity.java. I'm aware of examples that override AndroidManifest.xml via: This works fine, but not for the desired Java-File. I also...
Searle
1

votes
4

answer
322

Views

How to increase RGB darkness?

I am trying to increase darkness of RGB using pure math without relying on any framework .. So, here is my implementation: Provided with R, G, B ( each from 0 to 256 ) & darknessFactor ( 0 to 1 ) // this is a pseudocode r*= darknessFactor; g*= darknessFactor; b*= darknessFactor; r= int (r); g= int (...
simo
1

votes
2

answer
958

Views

Haxe libraries “Class not found : openfl.Assets”

BIG UPDATE Today, I wanted to work on something else and I realized that Haxe was completley down. In fact, I can't compile any library. Even openfl doesn't work. I tried to uninstall/reinstall Haxe without success. I was currently working on my library project. Everything was working fine and sudde...
Masadow
1

votes
1

answer
61

Views

How to attach a property to string?

Can I do something like this in haxe: trace ('Blue'.description); trace ('Green'.description); trace ('Red'.description); then, somewhere add a switch based on string value to return different description for each case? I saw people using this for localization, like 'Car'.i18() Any one can help?
simo
1

votes
1

answer
1.1k

Views

How to safely store secret key? [closed]

As I have developed my app using openFL which uses haxe, and I am about to start the activation part of my software, I wonder how would I safely store my encryption secret key? would I just hard code it into my app??! I will be using this key to encrypt data before sending to server, and I will be u...
simo
1

votes
1

answer
780

Views

newline characters (\n \r) not being respected with OpenFL flash.text.TextField on JS target

If I create a flash.text.TextField using OpenFL for a JS target, none of my newline characters are showing up. The textfield instead has one long string on a single line. I've tried changing .wordWrap and .multiline but they do nothing to change this behavior. haxe 3.1.3 openfl-html5 1.4.2
Craig
1

votes
1

answer
332

Views

Security Sandbox violation on Haxe http request

I'm making a game using Haxe and Flambe library targeting to flash&html5. I need to access REST-api with http-requests. For that purpose I use Haxe's Http-class. This here is my test code at the moment: public function getRocketStatus():Void { var urlLoader:Http = new Http('https://seginus-scores.he...
Tumetsu
1

votes
2

answer
360

Views

Is it possible to list embedded folder contents?

Is it possible to list embedded folder contents? I want to load all files from specific folder(s), w/o having to edit file list after adding each new file. Edit: If I try sys.FileSystem.ReadDirectory(), I get a 'You cannot access the sys package while targeting flash (for sys.FileSystem)' error for...
roma
1

votes
1

answer
1.2k

Views

Can't use embed font

I'm doing everything just like in the instruction. Class Fonts.hx import flash.text.Font; @:font('assets/fonts/OPENSANS-REGULAR_0.TTF') class OpenSansFont extends Font { } class Fonts { public static inline var OPEN_SANS_PATH = 'assets/fonts/OPENSANS-REGULAR_0.TTF'; public static inline var OPEN_SA...
momijigari
1

votes
1

answer
365

Views

Timer in command-line application

Trying to create a simple command-line application in Haxe which has a ticking Timer, but it does not seem to work out; the Timer never actually starts 'ticking'. package; import haxe.Timer; class TimerCallback { private static inline var CHAR_SPACE : Int = 32; public static function main() : Void {...
1

votes
2

answer
224

Views

Haxe IE9 xmlHTTPrequest issue

I'm having problems displaying my Haxe game in IE9. It's actually not displaying at all. We tracked down the issue inside the compiled JS file for Haxe and found out that the problem is within the haxe.HTTP API. There are certain things that need to be checked and done for IE9 to work with xmlhttpre...
Hassan Bazzi
1

votes
2

answer
281

Views

Haxe Java windowing

In the Haxe.java api at http://api.haxe.org/java/index.html, there does not appear to be any support for graphics, windowing, or user-interactive events. There used to be: http://old.haxe.org/doc/java/graphics2d (note the 'old'), but we can't use these libraries anymore: import java.awt.Graphics; //...
Kevin Kostlan

View additional questions