View unanswered posts | View active topics

Reply to topic  [ 2 posts ] 
[SOLVED] Preloader does not have a constructor - Haxe 
Author Message

Joined: Fri Jan 27, 2017 6:43 pm
Posts: 2
Reply with quote
I tried adding a preloader to my project (haxe) but I get those errors every time:
bin/flash/release/haxe/ApplicationMain.hx:307: characters 47-63 : Preloader does not have a constructor
bin/flash/release/haxe/ApplicationMain.hx:94: characters 14-29 : Called from macro here

Here is my preloader class:

class Preloader extends NMEPreloader
   public function new()
   override public function onUpdate(bytesLoaded:Int, bytesTotal:Int):Void
      super.onUpdate(bytesLoaded, bytesTotal);

And this is my project.xml:
<?xml version="1.0" encoding="utf-8"?>
   <!-- NMML reference: -->
   <!-- metadata, make sure 'package' is at least 3 segments (ie. com.mycompany.myproject) -->
   <meta title="Adaran" package="Adaran" version="1.0.0" company="Lubo" />
   <!-- output -->
   <app main="Main" file="Adaran" path="bin" preloader="Preloader" />
   <window background="0x2E2525" fps="60" />
   <window width="920" height="420" unless="mobile" />
   <window orientation="landscape" vsync="false" antialiasing="0" if="cpp" />
   <!-- classpath, haxe libs -->
   <source path="src" />
   <haxelib name="openfl" />
   <haxelib name="actuate" />
   <!-- assets -->
   <icon path="assets/openfl.svg" />
   <assets path="assets/img" rename="img" />
   <assets path="assets/fonts" rename="fonts" />
   <haxedef name="as3_native" if="flash"/>
   <haxeflag name="-swf-lib" value="NewgroundsAPI.swc" if="flash"/>
   <!-- optimize output
   <haxeflag name="-dce full" /> -->

A guy ran my project and it worked fine but I get those errors. I've reinstalled FD and haXe but same scenario and I'm up to date as far as I know.
I'm all open for suggestions.

Last edited by MadNukin on Mon Feb 06, 2017 5:47 pm, edited 1 time in total.

Fri Jan 27, 2017 7:32 pm

Joined: Fri Jan 27, 2017 6:43 pm
Posts: 2
Reply with quote
Forgot to mention that at the time I thought the problem was with FlashDevelop.
To fix it just read this: ... oader/8704

If you follow the instructions and your haxe, openfl and lime are up to date there's a good chance you'll be fine.

Mon Feb 06, 2017 5:43 pm
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.