Dynamically Casting In ActionScript
- by Joshua
Is there a way to cast dynamically in Actionscript? What I want to accomplish is illustrated by the following code:
var Val:*;
var S:String=SomeTextEdit.text;
switch (DesiredTypeTextEdit.text) {
case 'int':Val=int(S);break;
case 'uint':Val=uint(S);break;
case 'String':Val=String(S);break;
…