To expand further...
Is it possible to run an AIR application from within a c# application using the Flash Active X control? I have done this plenty of times with regular .swf files but I am not sure if it is possible with an AIR application that uses the "Extended Desktop" profile.
1 person found this helpful
You can't use AIR-only APIs from Flash ActiveX control. I'm not even sure
an empty AIR app fits in 15MB.
Thanks for the reply. I was worried that even stipped down AIR app would be pretty hefty...any idea what the baseline mem is for an extended desktop app?
I have been seriously considering stripping out all the AIR sepcific code, re-compiling it as a web app and just implementing it as a UI wrapped in c# using ExternalInterface. That way I could have better control over the memory issues...but that would require a lot of changes so I would really appreciate any other suggestions.
I don't know the number off-hand. Best to try it yourself.
Frameworks have a price. That's why an MFC app is much bigger than one
written right to the Windows API.
Yup, I understand that there is a trade off. I am willing to pay the large memory price to have the AIR UI but I just need a better way to control the memory usage when that UI is not needed. This application will be running for long periods of time and I can't have an app using 150+ MB of memory when it is just sitting idle in the system tray.
If I wrap it in an MFC app using the Flash Active X Control I can just dispose of the control when the app is inactive and the app memory usage will instantly drop to 15 MB. If there was a way to do this with AIR, perhaps loading/unloading all the UI as a module, that would be great.
Since my app only consumes 8 MB of memory on startup in the memory profiler yet consumes 120+ MB of memory on startup in the Task Manager there appears to be about 110MB of memory I do not have much control over, so I am increasingly doubtful that there will be an AIR only solution to my problem.
Yeah, I'm not surprised that Task Manager for AR is about 120MB. How about
just launching the AIR app from a native app when it is needed? Or do you
need some sort of UI integration?
Yeah, I think your suggestion is probably going to be my best bet. There is no real reason why they can not be seperate. I was initally leaning away from that solution becuse it would create multiple processes in the task manager, but I am thinking that is really not that big of a deal. Right now my app uses so much AIR specific code for the file system, sqlite, encrypted data store...and all that stuff is really elegantly instegrated into AIR, it would be a shame to have to ditch it.
I am gonna give this a go. Thanks again for all your input.
Awhile ago - Flash Player 9 days - I was working on an app that had integrated a C# WinForms UI with a Flash ActiveX control we were using for rendering content.
The biggest pain of that project was certainly back-and-forth interaction between the WinForms app and the ActiveX control - it was an extra pain every time to have to funnel all your calls through the ExternalInterface, marshal, dispatch back etc. It was ugly, but it worked. The biggest headache was probably the ActiveX control behaving very strangely with regards to focus - especially for drag-n-drop.
For your purposes - just using the native code as a launcher and background monitor - it seems like you won't have to worry about that much communication to AS3, sidestepping a lot of those headaches.