Page 1 of 1

How to Load flash file in memory From Web server ?

Posted: Fri Apr 07, 2006 1:44 am
by oneinus
Below code Does Not Works.. (C#)

string flashUrl = "http://www.zeum.co.kr/test.swf"

this.flashPlayerControl1.PutMovieFromStream(this.GetType().Assembly.GetManifestResourceStream(flashUrl));

this.flashPlayerControl1.FlashMethod_Play();

I want to Know How to Load flash file in memory From Web server ?

Posted: Fri Apr 07, 2006 8:32 am
by Softanics
Thank you for your question.

This code doesn't work because this.GetType().Assembly.GetManifestResourceStream(flashUrl) returns null, your application doesn't contain resource with name flashUrl = "http://www.zeum.co.kr/test.swf".
The right code is:

Code: Select all

string flashUrl = "http://www.zeum.co.kr/test.swf";

WebClient myClient = new WebClient();
Stream response = myClient.OpenRead(flashUrl);

this.flashPlayerControl1.PutMovieFromStream(response);

this.flashPlayerControl1.FlashMethod_Play();

response.Close();


The class WebRequest is in the System.Net namespace.