Let's say I have an interface
public interface IFoo {
...
}
and I have several implementing classes
public class Foo implements IFoo {
...
}
...
public class Bar implements IFoo {
...
}
...
public class Baz implements IFoo {
...
}
I want to reference IFoo in MXML like this
<ns:IFoo id="myfoo"/>
and have it be instantiated at runtime by a factory.
However, the compiler won't let me do this-- it's trying to do "new IFoo" in the generated ActionScript.
How to get around this? How can I use an interface and a factory purely in MXML?