Cannot load swf bundle

[trace] [lime.utils.AssetLibrary] WARNING: Could not find library type: openfl._internal.formats.swf.SWFLiteLibrary

<?xml version="1.0" encoding="utf-8"?>
<project>
	
	<meta title="EscapeEngineHaxe" package="com.sample.escapeenginehaxe" version="1.0.0" company="Javelin" />
	<app main="Main" path="Export" file="EscapeEngineHaxe" />

	<window width="960" height="540" background="#000000"/>

	<source path="Source" />
	
	<haxelib name="openfl" />

	<assets path="Assets/test" rename="assets"/>

</project>
var future = AssetLibrary.loadFromFile ("assets/testswf.bundle");

You need to re-run the openfl process to compile your swf file.

Hi.
Thanks for fast reply.
I run: openfl process Assets/testswf.swf
Then build the project.
Output folder:
image
project.xml

<?xml version="1.0" encoding="utf-8"?>
<project>
	
	<meta title="EscapeEngineHaxe" package="com.sample.escapeenginehaxe" version="1.0.0" company="Javelin" />
	<app main="Game" path="Export" file="EscapeEngineHaxe" />

	<window width="960" height="540" background="#000000"/>

	<source path="Source" />
	
	<haxelib name="openfl" />
	<haxelib name="actuate" />

	<assets path="Assets" rename="assets" embed="false" exclude="*.swf"/>

</project>

Code:

package ;

import openfl.utils.AssetLibrary;
import openfl.display.Sprite;

class Game extends Sprite{

    public function new() {
        super();

        init();
    }

    private function init():Void
    {
        var future = AssetLibrary.loadFromFile ("assets/testswf.bundle");
		future.onProgress (library_onProgress);
        future.onError (library_onError);
        future.onComplete (library_onComplete);
    }

    private function library_onError (result:Dynamic):Void {
        trace("library_onError");
    }

    private function library_onProgress (loaded:Int, total:Int):Void {
        trace("library_onProgress: " + loaded + " / " + total);
    }

    private function library_onComplete (library:AssetLibrary):Void {

        trace("library_onComplete");
    }
}

Output:

[trace] [lime.utils.Preloader] Preloading asset library
[trace] [lime.utils.Preloader] Loaded asset library [1/1]
[trace] [lime.utils.Preloader] Preload complete
[trace] Game.hx:27: library_onProgress: 248 / 248
[trace] [lime.utils.AssetLibrary] WARNING: Could not find library type: openfl._internal.formats.swf.SWFLiteLibrary
[trace] Game.hx:23: library_onError

Generated debug.hxml

-main ApplicationMain 
--macro openfl._internal.macros.ExtraParams.include()
-cp C:/HaxeToolkit/haxe/lib/openfl/8,9,0/src
-D openfl=8.9.0
--macro lime._internal.macros.DefineMacro.run()
-cp C:/HaxeToolkit/haxe/lib/lime/7,3,0/src
-D lime=7.3.0
-cp C:/HaxeToolkit/haxe/lib/actuate/1,8,9/src
-D actuate=1.8.9
-cp Source
-cp C:/HaxeToolkit/haxe/lib/openfl/8,9,0/externs/flash
-cp Assets/testswf.bundle/src
-D native-trace
-D tools=7.3.0
-D ANDROID_SETUP=true
-D flash-use-stage
-D ANDROID_NDK_ROOT=C:\Users\CrazyFlasher\Documents\work\Tools\android\android-ndk-r13b
-D no-compilation
-D openfl-flash
-D debug
-D JAVA_HOME=C:\Program Files\Java\jdk1.8.0_101
-D fdb
-D openfl-disable-handle-error
-D verbose=1
-D web
-cp Export/flash
-swf-lib obj/assets.swf
-swf-version 17
-swf Export/flash/bin/EscapeEngineHaxe.swf
-cp Export/flash/haxe
-debug

Tried with HTML5 target:

[Sat May 18 2019 10:34:52 GMT+0300 (FLE Daylight Time)] "GET /" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36"
[Sat May 18 2019 10:34:52 GMT+0300 (FLE Daylight Time)] "GET /EscapeEngineHaxe.js" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36"
[Sat May 18 2019 10:34:53 GMT+0300 (FLE Daylight Time)] "GET /assets/build.xml?572122" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36"
[Sat May 18 2019 10:34:53 GMT+0300 (FLE Daylight Time)] "GET /assets/Spotlight.xml?572122" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36"
[Sat May 18 2019 10:34:53 GMT+0300 (FLE Daylight Time)] "GET /assets/testswf.swf?572122" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36"
[Sat May 18 2019 10:34:53 GMT+0300 (FLE Daylight Time)] "GET /assets/testswf.bundle/library.json" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36"
[Sat May 18 2019 10:34:53 GMT+0300 (FLE Daylight Time)] "GET /assets/testswf.bundle/assets/testswf.bundle/swflite.bin?572122" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36"
[Sat May 18 2019 10:34:53 GMT+0300 (FLE Daylight Time)] "GET /assets/testswf.bundle/assets/testswf.bundle/swflite.bin?572122" Error (404): "Not found"

It tries to use to wrong path is wrong for some reason:

/assets/testswf.bundle/assets/testswf.bundle/swflite.bin

Changed rootPath to “” and now it works for html5. But not for flash.

I no longer use flash, I am not familiar with this situation.

How do you html5 debug project? As I know debugging is not supported with html5 target

So error reason for flash target is:
"Could not load asset manifest"

If I use openfl.display.Loader, I get IOError, however bundle exists (flash target)


        var loader = new Loader ();
        loader.contentLoaderInfo.addEventListener (ProgressEvent.PROGRESS, loader_onProgress);
        loader.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, loader_onError);
        loader.contentLoaderInfo.addEventListener (Event.COMPLETE, loader_onComplete);
        loader.load (new URLRequest ("assets/testswf.bundle"));

On android it also goes to library_onError.
And I can’t even use breakpoints (or possible?)
I think its time to give. Too much time and mess.

On html5, you can compile with debug flag, source map will be build with your code. Then you can set breakpoint directly in the console of the Chrome browser.

On Flash, use a *.swf not a *.bundle

it seems you are missing the swf library : just add this image to your project.xml it should work.

Now I receive:
[Fault] exception, information=SyntaxError: Error #1132: Invalid JSON parse input.
Code:

private function loadAssets():Void
    {
        if (libName != null)
        {
            Assets.unloadLibrary(libName);
        }

         #if html5
            libName = "assets/levels/" + levelId + "/" + levelId + ".bundle";
        #elseif flash
            libName = "assets/levels/" + levelId + "/" + levelId + ".swf";
        #end

        var future = Assets.loadLibrary (libName);
        future.onComplete (library_onComplete);
        future.onProgress (library_onProgress);
        future.onError (library_onError);
    }

project.xml

<?xml version="1.0" encoding="utf-8"?>
<project>
	
	<meta title="EscapeEngineHaxe" package="com.sample.escapeenginehaxe" version="1.0.0" company="Javelin" />
	<app main="Main" path="Export" file="EscapeEngineHaxe" />

	<window if="mobile" orientation="landscape" background="#000000" fps="60"/>
	<window if="html5" width="960" height="540"/>

	<source path="Source" />
	
	<haxelib name="swf" if="flash"/>
	<haxelib name="openfl" />
	<haxelib name="actuate" />

	<assets path="Assets/Spotlight" rename="assets" exclude="*.swf|*.xml" embed="false" if="html5"/>
	<assets path="Assets/Spotlight" rename="assets" exclude="*.xml" embed="false" if="flash"/>

</project>

If I include haxelib swf to project, I receive compile error:
Error:Enum not found lime.tools.AssetType

[SOLVED]

        #if html5
            libName = "assets/levels/" + levelId + "/" + levelId + ".bundle";
        #elseif flash
          libName = "level_0";
        #end

        var future = Assets.loadLibrary (libName);

The “swf” haxelib is deprecated – it was merged into OpenFL proper a few major versions ago