How do you declare a variable type that is the same name as the current class in a different package? Is it possible?
[COLOR=black][FONT=Verdana]I’m importing the class and using getDefinitionByName for the instantiation. However, without declaring a variable of that time, the class is not being imported.[/FONT][/COLOR]
[FONT=Verdana][COLOR=black][COLOR=black][FONT=Verdana]package a {[/FONT][/COLOR]
[INDENT][COLOR=black][FONT=Verdana]public class CustomClass {[/FONT][/COLOR]
[COLOR=black][FONT=Verdana]}[/FONT][/COLOR]
[/INDENT][COLOR=black][FONT=Verdana]}[/FONT][/COLOR]
[/COLOR][/FONT]
[FONT=Verdana][COLOR=black]
[COLOR=black][FONT=Verdana][COLOR=black][FONT=Verdana]package b {[/FONT][/COLOR]
[INDENT][COLOR=black][FONT=Verdana]import a.CustomClass;[/FONT][/COLOR]
import flash.utils.getDefinitionByName;
[COLOR=black][FONT=Verdana]public class CustomClass {[/FONT][/COLOR]
[INDENT][COLOR=black][FONT=Verdana]private var _customClassA : ?????[/FONT][/COLOR]
[COLOR=black][FONT=Verdana]private var _customClassB : CustomClass;[/FONT][/COLOR]
[COLOR=black][FONT=Verdana]public function CustomClass {[/FONT][/COLOR]
[INDENT][COLOR=black][FONT=Verdana]_customClassA = new ( getDefinitionByName( "a::CustomClass" ) );[/FONT][/COLOR]
[/INDENT][COLOR=black][FONT=Verdana]}[/FONT][/COLOR]
[/INDENT][COLOR=black][FONT=Verdana]}[/FONT][/COLOR]
[/INDENT][COLOR=black][FONT=Verdana]} [/FONT][/COLOR]
[/FONT][/COLOR]
[/COLOR][/FONT]