/ Published in: ActionScript 3

Here is an example of a sound that is in a library with the class field set to MySound.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import flash.utils.getDefinitionByName; var SoundRef:Class = getDefinitionByName("MySound") as Class; var _sound:Sound = new SoundRef(); _sound.play();
URL: http://evolve.reintroducing.com/2009/08/03/tips-n-tricks/tip-convert-an-object-to-a-class-by-name/
Comments
