I am trying to create a quizzer when the questions are in components. I want to import the component and add it to the stage based on the question that next and the quiz they are taking. If they load test 1 i need it to:
import com.ipexpert.test.1.question1; var currentQuestion:question1 = new question1; questionArea.addChild(currentQuestion); I have the varible for the test loaded: testID and the current question: questionNum I am trying to build it on the fly with something like: import com.ipexpert.tests. + testID + "." + "question" + questionNum; var currentQuestion:question + questionNum = new question + questionNum; questionArea.addChild(currentQuestion); Needless to say it is wrong and I am getting an errors: 1084: Syntax error: expecting identifier before plus. for the first line (imprt com.ipexperts...) and 1086: Syntax error: expecting semicolon before plus. for the second line (var currentQuestion...) Any better ideas or how can I write this right?