1 person found this helpful
To embed a SWF in a .NET application as you've been doing, you're using the Flash Player ActiveX control hosted in your application.
There is no AIR equivalent to the Flash Player ActiveX control, and (as you guessed) the AIR-only apis are not available in Flash Player.
AIR is designed for creating standalone applications, not user interfaces hosted in other applications. Some people create AIR applications that communicate with other non-AIR code (such as Java or .NET code) but in that case the application is architected somewhat differently. Instead of it being a .NET application that includes a Flash Player (or AIR) control, the whole thing runs as two separate applications -- the AIR application that provides the user interface and probably as much functionality as possible, with the Java/.NET application running in the background (in a way that's usually described as a "server" or "service"). Communication between them can happen in various ways, but most commonly the server app runs a socket server and the AIR app communicates to the server app using the Socket class.
One approach for doing this with .NET is Mike Chambers' CommandProxy project:
For Java there's the Merapi project, which has been in development longer and is more polished -- but of course you've made it clear that you need C# =)
Unfortunately this architecture complicates things somewhat because it means you have to have a way to install both apps together, and run both apps together. I believe the typical approach is to have the executable that the user actually runs be the server part, and have it load the AIR app as soon as it's executed. (Or alternatively, to have a third bootstrapper application that is the one the user runs, that loads both the server and the AIR UI app.)
Since the early days of AIR one of the most vocal feature requests has been the ability to call native code or other processes from within an AIR app., and you can rest assured that this will be implemented some day. But as things stand in the current version of AIR, the approach I described above is how other developers implement this kind of application.
As a complete side note, if you are using the Flash Player ActiveX control in a .NET app, you can use the ExternalInterface class rather than fscommand. The documentation includes a sample app demonstrating using the ExternalInterface class to embed a SWF UI in a C# app.
Well I guess what I was afraid is true. But no problem.
My thought is to have a blended UI. I will have flex fill an entire window except charp drag-drop-container that is docked at the bottom of the window.