I faced a problem with
Assets.loadLibrary() with the handler function definition like this:
I get a following error:
src/com/creativemage/libLoader/LibraryLoader.hx:29: characters 35-46 : a : openfl.AssetLibrary -> Void should be lime._Assets.LimeAssetLibrary -> Void
How should I rewrite my code to work consistently across all platforms?
For now, the easiest way is to ignore the parameter in your callback:
Assets.loadLibrary ("hello", function (_) trace ("hi"));
Also, the tag should now have a “preload” attribute you can use to avoid calling loadLibrary altogether
Do you think this will ever change? I’ve made a small framework that loads other libraries and I’d like to know it’s stable.
Is there something I could do on my end to make the code more resilient to change? For example require features of specific OpenFL version etc.?
Perhaps we should not be returning the library in the callback. I’m not sure. Basically this happened because now Lime has Assets, OpenFL extends the Lime asset system instead of defining it on it’s own. If you do not use the returned library instance (I’m guessing you do not?) then using an underscore to ignore the parameter should always work