"Too many arguments" on loadLibrary

Updated to openfl 6.0.1 and lime 5.3.0 and getting “Main.hx:622: lines 622-625 : Too many arguments” on:

Assets.loadLibrary (“SCO17”, function (_) {clip1 = Assets.getMovieClip (“SCO17:SCO17”);});

Auto complete looks fine… it is just one value being passed. Runs like this on previous versions.
Probably missing something obvious…

Actually got it, no function allowed in there anymore it looks like it.

Brings me to my next problem, everything in a URLRequest is throwing :

Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

Yeah, that was removed in OpenFL 6 (and deprecated a long time ago) :slight_smile:

I think Assets.loadLibrary ("SCO17").onComplete (function (_) {clip1 = Assets.getMovieClip ("SCO17:SCO17");}); would be the equivalent.

If you get URLRequest issues, what platform? What are you attempting to load when it occurs?

Trying to laod a .png file. Works if I revert to older openfl/lime. I’m on windows 10.

It is coming from this line: loader.load(new URLRequest(“img/SCO17/Genericos/Generico-Jogo.png”));

Does this work?

var path = "img/SCO17/Genericos/Generico-Jogo.png";

trace ("current working directory: " + Sys.getCwd ());
trace ("file exists: " + sys.FileSystem.exists (path));

var bitmapData = BitmapData.fromFile (path);
trace ("bitmapData: " + bitmapData);

BitmapData.loadFromFile (path).onComplete (function (bitmapData) {
    trace ("async bitmapData: " + bitmapData);
});

This may help to debug if the file exists, and if our standard file loading code is working

I’m on windows 10 targeting flash. Forgot to include the target, so not a system plat.

The file exists, I can load it if I revert to an older openfl/lime convo.

Check your output directory, perhaps the file is not being copied, but is being embedded into the SWF directly:

trace (Assets.getBitmapData ("img/SCO17/Genericos/Generico-Jogo.png"));

That also throws: Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

Okay, I guess I’m going to need to know more information about this:

1.) Does this work if you target anything other than Flash?
2.) What does the <asset /> tag look like?
3.) Is the file being copied alongside the Flash SWF, or does it appear to be embedded?
4.) Can you use -verbose when you build? Does it show the asset as embedding?
5.) Does the error give any more information, such as the URL it is trying to load?

-verbose shows: - Embedding asset: (IMAGE) assets/img/SCO17/Genericos/Generico-Jogo.png

though I have no clue why, there’s loads more files that it isn’t embedding.

Can’t build for another target, video playing stuff in there.
I don’t know if it is being copied but it is there.
The error is just that, I had to guess the line it was coming for. Though all other subsequent urlrequests fail just the same if I choose to continue and with the same error.

There is a chance there is a mismatch where (somehow) the tools are both embedding your asset, but also trying to load it later as if it is not embedded.

Is there any chance I could try and build your project? Please feel free to send a private message (I’ll keep it under NDA) and can try and take a look. I’m not sure I’ve seen this error before, it seems like some sort of minor mixup in the asset loading code. Otherwise, I don’t know if you have a way to isolate this issue, like by changing the “DisplayingABitmap” sample with a similar <asset /> tag as your project, etc

Thanks!