/ Published in: ActionScript 3
URL: http://evolve.reintroducing.com/2009/08/03/tips-n-tricks/tip-convert-an-object-to-a-class-by-name/
Here is an example of a sound that is in a library with the class field set to MySound.
Expand |
Embed | Plain Text
import flash.utils.getDefinitionByName; var SoundRef:Class = getDefinitionByName("MySound") as Class; var _sound:Sound = new SoundRef(); _sound.play();
You need to login to post a comment.
