I create var
for my movieclip that has long animation like this:
public var swftest = Assets.getMovieClip ("library:MovieclipA");
and then I add it on screen like this:
public function animation_test()
{
s_container.addChild(swftest);
}
for some reason it causes memory leak, as if Haxe doesnt know how to handle looping animation in a movieclip... If I do swftest.gotoAndStop(1);
it wont anymore cause memory leak... If I let swftest
just play, it will cause crash in about 50 seconds as it takes more and more memory.
Here is snippet from project.xml
where I enable loading assets from library.swf
if it helps to solve this problem:
<!-- classpath, haxe libs -->
<source path="src" />
<haxelib name="openfl" />
<haxelib name="swf" />
<haxelib name="actuate" />
<!-- assets -->
<library path="Assets/library.swf" type="swflite" preload="true" generate="true" />
<assets path="Assets" rename="assets" exclude="openfl.svg|*.swf" />
<icon path="Assets/openfl.svg" />
Help sincerely appreciated!
Solved it by switching type="swflite"
to type="swf"
from project.xml
.
Here is part of my project.xml that lets me use .swf library:
<haxelib name="swf" />
<library path="Assets/library.swf" type="swf" preload="true" generate="true" />
<assets path="Assets" rename="assets" exclude="openfl.svg|*.swf" embed="true" />
Now it works just fine, no memory leak.