Re: How to add a SWF library

There are two ways you can use SWF assets in NME: - You can add a tag, and the command-line tools will automatically generate classes for all the symbols found in the SWF - You can include the SWF with , then use "var swf = new SWF (Assets.getBytes…

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

singmajesty

singmajesty
Total Posts: 2141
Joined: August 25, 2011

There are two ways you can use SWF assets in NME:

- You can add a <library /> tag, and the command-line tools will automatically generate classes for all the symbols found in the SWF
- You can include the SWF with <assets />, then use "var swf = new SWF (Assets.getBytes ("mochi.swf"));"

This will give you the ability to either use "new Symbol ()" or "swf.createMovieClip ("Symbol");" in order to instantiate SWF assets. I'm guessing that you may have to make some modifications to the original code, perhaps, in order to connect it up to where you have your symbol instances.

If you just need to instantiate a copy of the full root SWF, you could also use "swf.createMovieClip("");" (an empty string) which will create an instance of the SWF's stage.

Posted on March 20, 2012 at 11:43 AM