2

I'm using the AxShockwaveFlash object to load an extern .SWF file into my C# application. The AxShockwaveFlash takes in a URL for the movie to load. To load a local file, I can use a file:/// url string, which works fine.

However, I'd really prefer that the SWF be embedded in the compiled executable, but the the AxShockwaveFlash object requires the string url to load.

Does anyone have any good ideas on how this can be achieved, short of writing the file to a location on the computer when the executable is run?

Thanks.

jjw
  • 71
  • 1
  • 5

4 Answers4

0

I think you have only one option - write resource file to Temp dir and play it.
You can locate Temp folder from System.IO.Path.GetTempPath();

Anton Semenov
  • 6,227
  • 5
  • 41
  • 69
0

Check out res:// URL scheme

http://msdn.microsoft.com/en-us/library/aa767740(VS.85).aspx

Ankur
  • 33,367
  • 2
  • 46
  • 72
0

If you are dealing with an ASP.NET application, you could use Page.ClientScript.GetWebResourceUrl to generate the Url. Otherwise, I think you're best bet is the "res://" scheme as Ankur suggests.

SonOfPirate
  • 5,642
  • 3
  • 41
  • 97
0

Already answered on stackoverflow: C#: Loading an embeded swf into an flash activex without a temporary file

Community
  • 1
  • 1
Frederik
  • 2,921
  • 1
  • 17
  • 26