Following up from a discussion that ibilon asked me to create a new thread for this particular issue as apparently it’s unrelated to the topic, which I beg to differ. Whichever the case, I have done a cut and paste and have been encouraged to spam the forums with new threads.
I do have a question regarding the swf library. This page explains that the library works in native, but I can’t seem to get it to work with this code (using the latest OpenFL 3.1 and Lime 2.4.4 with swf version 1.8.7):
class Main extends Sprite
{
private var clip:MovieClip;
private var timeLoaded:Date;
public function new()
{
super();
Assets.loadLibrary("game", function(_) {
clip = Assets.getMovieClip("game:");
clip.gotoAndStop(0);
addChild(clip);
});
timeLoaded = FileSystem.stat("libraries/game/game.swf").ctime;
trace(timeLoaded.getTime());
addEventListener(Event.ENTER_FRAME, load);
}
private function load(e:Event)
{
#if sys
if (FileSystem.exists("libraries/game/game.swf"))
{
var fi = FileSystem.stat("libraries/game/game.swf");
if (fi.ctime.getTime() > timeLoaded.getTime())
{
trace("Some time");
Assets.loadLibrary("game", function(_) {
clip = Assets.getMovieClip("game:");
addChild(clip);
});
timeLoaded = fi.ctime;
}
}
#end
}
}
The swf library I’m loading looks like this, but the result seems to be a white screen for some reason. Does the swf library actually work in native targets, or is there a bug? I have also tried legacy and that seems to also result in a blank screen, which is very odd.
EDIT: After testing in Flash, I have encountered an error using the swf file in 3.1 with the following:
VerifyError: Error #1053: Illegal override of writeByte in haxe.io.BytesOutput.
ReferenceError: Error #1065: Variable boot_1838 is not defined.
Now I’m wondering if the “swf” haxelib library works on Haxe-developed SWF’s or only Flash Pro developed SWF’s… or should it not matter?