I’ve been trying out various tutorials from github, the documentation, topics in this forum, but none seem to fix the problem I’m having.
I have a swf file which has a movie clip in it, that I want to use. But every time I do it gives me error such as There is no asset library named "" and other similar errors.
I’ve tried doing/changing various things but I still couldn’t get the movie clip in my game.
I’ve looked at similar samples before (like the ones with Assets.loadLibrary() or swflite etc.) but they didn’t work too. I’ll do it again step by step, maybe you can see where it goes wrong:
I put in <haxelib name="swf" /> in project.xml, since it’s a library needed for reading swf’s
I put in the swf I need (named Grounds.swf) so now I have Assets/swf/Grounds.swf
In project.xml I put in <library path="Assets/swf/Grounds.swf" preload="true" /> right before <assets path="Assets" rename="assets" embed="false" />
I add in the movieclip in Main’s new(). There is a movieclip in the swf which, in Flash CS6 has an AS Linkage of “WoodGround” (which I assume is its name). So I put in this.addChild(Assets.getMovieClip("Grounds:WoodGround"));
Your Grounds.swf is in the swf subfolder, so I think you have to access it differently. Maybe in the getMovieClip() you can specify the path like so: "swf/Grounds:WoodGround"?
The official example (SimpleSWFLayout) works. I’ve tried replicating everything from it, but still nothing appears. No errors, it’s just not showing up.
Worse case scenario I might as well just port the entire game to Flash AS3