I'm using Adobe's CS Extension Builder, and I've abstracted away concrete implementations of certain classes with interfaces, to enable testing.
How do I then cast the API classes to the interface? I though with AS3 being a dynamic language, doing it like: "Application as IApplication" would work, but it doesn't. Note that the interfaces specify what is in those implementations and nothing more, so from a dynamic point of view it should work.
I tried the following as suggested, but it leaves iApp null. It may be that one of the properties in the interface returns a concrete type in Application, but again uses an interface for abstraction purposes.
var app : Application = Photoshop.app;
var iApp : IApplication = app as IApplication;
ApplicationimplementIApplication. Then there is no need to cast toIApplication. - mazatwork