C #: load embedded swf in Flash activex without temp file

My project requires my final application to be contained entirely in a single exe. I am already merging the executable and dll using ILMerge (assmebly merge utility). I am hosting an x ​​active control in a C # application and I have included one swf that I need to load into flash management in a C # application as an embedded resource.

This question shows how to write a resource to a temporary file , but it is not desirable to create temporary files for my situation. This poses a problem because the active control method loadMovie x only accepts a line indicating the file being loaded.

My question is: Is it possible to dynamically load embedded swf resources into the active x control without creating a temporary file?

+2


source to share


2 answers


The solution I ended up with was to package all the necessary swf files into a wrapper swf library.

Then I set the movie property of the activex element in the wrapper swf and set the embed flag on the activex element to true. This inserts this swf directly into the activex control. I've never done any kind of loading in C #, instead I just call the play () method of the x active control to initialize the swf file that was nested.



Basically, if im injecting a resource, there is no need to do it in C #, I can just inject it into swf. Then I did all the loading and unloading in a flash wrapper swf.

+1


source


you can add swf file to resources and then in runtinme read the file as byte array by sending it to this function



System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(YourForm));
System.Byte[] data = (System.Byte[])(resources.GetObject("FileName"));

      

+1


source







All Articles