Embeded SWFs won't load in recent OpenFL versions

I have a project working in 4.4.1 where I’m converting a very massive project from Flash to OpenFL. However when I realized I hadn’t updated OpenFL for a very long time and went to update, I found my project no longer worked. The problem seems to be in my use of SWF assets. I’ve created an example project that does what my company project does: https://github.com/jrdoughty/pains/tree/master/stuckin441

It complains about a SWFLite library. The error is in the readme file at the base of the stuck project

I’m hoping if this works that the latest OpenFL will deal with some of my problems with swf sounds and transparency, but until it can compile I can’t find out. I’ve included the fla just in case there is a setting that needs changed in the published swf.

Thanks in advance!

I use swf assets without any problem. The only difference is I generally link the MovieClips, not the bitmapdata. You can try putting them in Movieclip and then access it, assuming it is bitmapdata probably that might be causing the problem.

That was my initial approach, however the movieclips would be empty of library objects in html5 and c++, so I had to start importing individual assets. I’ll try importing the movieclip as a whole and see what happens though.

Sadly no difference. I’m still getting the swflite error. I feel like the problem is probably in my project xml, but I’m setup in a way that worked in 4.4.1 and I believe in a way that lines up with the using swfs examples.

Make sure you aren’t including <haxelib name="swf"/> in your project.xml for the latest version as that library has been rolled into openfl.

edit: woops! just saw you’ve done that

Yeah I know, you’d think that’d be the cause going by the symptoms. Its why I still believe I’m missing something in my setup, but I’m unsure as to what.

I was able to compile and run without any errors but the bitmapdata was null :confused:

I could see the two images in the html5 export lib folder

Fixed :slight_smile:

1 Like

Awesome! I’ll pull it up and see if I’m set!

I still get the SWFlite error. I have rebuilt with the minify off and get this error now:
"Error: Class not found format.swf.lite.SWFLite at haxe_Unserializer.unserialize (http://localhost:2000/Stuck.js:3041:11) at Function.openfl__$internal_swf_SWFLite.unserialize (http://localhost:2000/Stuck.js:37841:22) at onComplete (http://localhost:2000/Stuck.js:38046:47) at openfl_events__$EventDispatcher_Listener.callback (http://localhost:2000/Stuck.js:38105:5) at openfl_net_URLLoader.__dispatchEvent (http://localhost:2000/Stuck.js:259:15) at openfl_net_URLLoader.dispatchEvent (http://localhost:2000/Stuck.js:164:15) at http://localhost:2000/Stuck.js:51932:12 at lime_app_Promise.complete (http://localhost:2000/Stuck.js:9116:6) at http://localhost:2000/Stuck.js:19312:12 at lime_app_Promise.complete (http://localhost:2000/Stuck.js:9116:6)"

I’m curious why I’m unable to get past this. I may try testing this on another machine here shortly.

Something seems strange, since merging SWF, this class was renamed openfl._internal.swf.SWFLite, so the data you’re getting seems like it’s from an old copy of the SWF tools.

Could you use openfl test html5 -clean in case there’s old data it’s picking up?

You can also use -verbose when you build, to be sure it calls openfl process and not swf process

1 Like

Adding clean did it! Woot! I’ll give that a try on the main project and see what happens!

1 Like

Well, the main project isn’t out of the woods yet, but its different asset issues. I’ll follow up in the morning here if its related, but if its not I’ll start a new topic.

Thank you guys for all the assistance! I can’t tell you how excited I am to figure this stuff out and push this project forward!