polymod icon indicating copy to clipboard operation
polymod copied to clipboard

[BUG] Unknown identifier Assets for argument 'assetHandler'

Open AltronMaxX opened this issue 3 years ago • 2 comments

What does polymod mean by "Assets"? image

AltronMaxX avatar Jan 18 '23 15:01 AltronMaxX

When loading a script, a class which extends HScriptable will call Assets.getText() to retrieve the data of the script file.

This means that the class needs to import an Assets class, for example lime.utils.Assets or openfl.utils.Assets. HScriptable doesn't add that import for you because we don't know what framework you're using.

If you're having this issue with a specific framework that isn't Lime/OpenFL/HaxeFlixel, let me know.

Leaving this open because this error is supposed to be more verbose (Class does not import an Assets class for Polymod to fetch scripts with!) but it's not for some reason.

EliteMasterEric avatar Jan 19 '23 02:01 EliteMasterEric

Okay, so I did the right thing by importing openfl.utils.Assets.

AltronMaxX avatar Jan 19 '23 04:01 AltronMaxX