I have recently moved from AS2 to AS3 and I am finding the transition fairly easy, however I do have a few questions, some of which may not have been possible with AS2 but I would like to achieve them in AS3
-
Is it possible to pass the name of a class as an argument in a function and then use it to create a new instance. e.g
testFunc(ClassName);
function testFunc(passedClass) {
var ob:* = new passedClass;
} -
Carrying on from the previous question, if a class can infact be passed, can I specifying a variable type for the argument so that only classes and not instances will be accepted?
-
I have three class files that all inherit some functions and variable from another class called Ship. Is it possible to specifying a variable type so that the variable can only hold instances of classes that are inherited from the Ship class?
Any help with these questions would be massively useful,
Thank you in advance
Dhryn