This will load an embedded swf resource as a binary memory stream right into a form-embedded Flash player COM object (without creating a temporary file). Please note that the capabilities of the SWF will be limited to the "standard" Flash Player sandbox, you cannot embed & run AIR swfs that use desktop/extendedDesktop in this way.
I've created a GitHub Project with the full code and a sample swf.
1) compile the AIR application as an SWF
2) create a new C# Forms project
3) In the Solution Explorer, right-click on "References" and add "ShockWave Flash" from the COM tab
4) In the Solution Explorer, right-click on the project and select "Properties". Select the "Resources" tab in the newly opened form and add your SWF as a resource.
5) From the "General" tab in your Toolbox, drop a "ShockWave Flash" component on your form
6) Add the following code to your form:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Reflection;
using System.Windows.Forms;
using System.Diagnostics;
using System.IO;
namespace SwfRes
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
LoadBinSwf();
}
private void LoadBinSwf()
{
//Assuming your swf is called "Main.swf"
byte[] swf = Properties.Resources.Main;
MemoryStream memStream = new MemoryStream();
BinaryWriter writer = new BinaryWriter(memStream);
writer.Write(8 + swf.Length);
writer.Write(0x55665566);
writer.Write(swf.Length);
writer.Write(swf);
memStream.Seek(0, SeekOrigin.Begin);
axShockwaveFlash1.OcxState = new AxHost.State(memStream, 1, false, null);
}
}
}