Re: How to add a SWF library

Hi again! Let's say you had a SWF that exported a symbol called "MySymbol" With the first approach, NME will automatically include the "swf" haxelib while compiling, and will generate a Haxe class called "MySymbol" for you, automatically. You could …

Viewing 1 to 1 (1 Total)
Re: How to add a SWF library

singmajesty

singmajesty
Total Posts: 2140
Joined: August 25, 2011

Hi again!

Let's say you had a SWF that exported a symbol called "MySymbol"

With the first approach, NME will automatically include the "swf" haxelib while compiling, and will generate a Haxe class called "MySymbol" for you, automatically. You could instantiate your symbol by using "var mySymbol = new MySymbol ();" ... this is the most similar to how SWC embedding normally works in Flash.

In the second approach, I forgot to mention that you need to add "<haxelib name="swf" />" to your project NMML file. It's true, the SWF class is not included in NME by default, but it is another library that's easy to include in a project smiling

Posted on March 21, 2012 at 3:32 PM