Imports a wav or mp3 file as DefineSound swf tag.
| import | Path to the file to be imported. |
| class | Class name assigned to imported data. |
| genclass | (false, symbolOnly, symbolAndClass) Controls the generation of symbols and AS3 class stubs. Available values are: false (don’t generate neither symbol nor AS3 class stub), symbolOnly (generate only symbol), symbolAndClass (generate symbol and AS3 class stub) |
| flash.media.Sound | The superclass of AS3 class stub. |
Assuming that Sound import module is assigned to namespace snd the following snippet imports pickup.mp3, exports it with symbolclass name resources.PickupSound and generates a corresponding AS3 class stub (default behavior):
<snd:sound import="pickup.mp3" class="resources.PickupSound"/>
Manual creation of class stub. First import the file with genclass set to symbolOnly
<snd:sound import="explode.wav" class="resources.ExplodeSound" genclass="symbolOnly"/>
then define the class stub in haXe:
package resources;
class ExplodeSound extends flash.media.Sound {
public function new() {
super();
}
}