While playing the .SWF file in windows forms as below, I noticed that it doesn't takes any relative paths.
What is done below is that each time the PlayVideo Form Dialog opens it loads a new video which I was tracking using a global variable: GlobalVariablesTracking.videoTrack
and incremented it after successfully loading a video.
private void PlayVideo_Load(object sender, EventArgs e)
{
CurrentVideoKey = GlobalVariablesTracking.videoTrack;
currentVideoName = ConfigurationManager.AppSettings[CurrentVideoKey.ToString()];
if (!String.IsNullOrEmpty(currentVideoName))
{
GlobalVariablesTracking.videoTrack = GlobalVariablesTracking.videoTrack + 1;
axShockwaveFlash1.Movie = "\\Videos\\" + currentVideoName;
axShockwaveFlash1.Play();
}
}
Below are the Keys I read from App.Config
<add key="1" value="a.swf"/>
<add key="2" value="b.swf"/>
.....
The issue I encountered in the line:
axShockwaveFlash1.Movie = "\\Videos\\" + currentVideoName;
It doesn't takes relative path. If a complete absolute path is specified as below, it works perfectly.
axShockwaveFlash1.Movie = "C:\\Videos\\" + currentVideoName;
How to get this ShockWave flash object to work with a Relative URL ?
Finally got this working.
The solution was to use
Application.StartupPath
and append to it the rest of your relative path.This MSDN article was really helpful.