creating object according to the switch case value
- by vincent
hello,
i have the following switch case:
switch (appModel.currentPage){
case "Programma":
case "Winkelwagen":
case "Films":
case "Contact":
if (page){
removeChild(page);
}
//here i would like to create a new object page that has the type of the switch.
i mean this: var page: getDefinitionByName(appModel.currentPage+"Page");
this doesnt work thou but it should be something like: "FilmsPage or ContactPage or ...".
addChild(page);
break;
Does anyone know how to do this?