1

I am trying to use the trace method to print a string on the screen. I thought that Haxe code should work in Flambe, but apparently it doesn't. I tried to run this code but all I get is a black screen:

package urgame;

class Main {
  static public function main():Void {
    trace("Hello World");
  }
}

I took the code from this haxe guide.

I also tried to use this code but the result is identical (black screen):

package urgame;

import flambe.Entity;
import flambe.System;
import flambe.asset.AssetPack;
import flambe.asset.Manifest;
import flambe.display.FillSprite;
import flambe.display.ImageSprite;
import flambe.display.Sprite;

class Main
{
    private static function main ()
    {
        // Wind up all platform-specific stuff
        System.init();

        // Load up the compiled pack in the assets directory named "bootstrap"
        var manifest = Manifest.fromAssets("bootstrap");
        var loader = System.loadAssetPack(manifest);
        loader.get(onSuccess);
    }

    private static function onSuccess (pack :AssetPack)
    {
        trace('Hello World');
    }
Robert777
  • 801
  • 3
  • 12
  • 24
  • 1
    In Flash debug builds I think traces might display on the SWF screen in a scrolling text field. On other targets it might only be printed to a console or debug output that you won't normally see? – Sam Twidale Jul 14 '16 at 20:38
  • What target are you compiling to? Are you using an IDE? – Gama11 Jul 14 '16 at 20:50
  • I use FlashDevelop but compile it using the command prompt – Robert777 Jul 15 '16 at 00:57

1 Answers1

1

If you run the html version the traces should be displayed in the browser console. So do build and run (debug build) and hit F12 in the browser.

Mark Knol
  • 9,663
  • 3
  • 29
  • 44