Is there a way to reload the shockwave component?
I have a shockwave component on my form and a button. When I click the button it opens a filedialog which lets me find the flv file to play. In the same click action I write an xml file with the flv name and the shockwave plays the movie.
If I click on the button again while the movie is playing and select another flv, the xml file is updated but the shockwave component won't play the new selection. I have to close the application and restart inorder for the application to play the new selection.
how can I correct this?
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim sReplaceChar As String sReplaceChar = "" ' Displays an OpenFileDialog so the user can select a Cursor. Dim openFileDialog1 As New OpenFileDialog openFileDialog1.Filter = "Flash Video Files|*.flv" openFileDialog1.Title = "Select a FLV File" If openFileDialog1.ShowDialog() = DialogResult.OK Then Dim sr As New System.IO.StreamReader(openFileDialog1.FileName) 'MessageBox.Show(sr.ReadToEnd) sr.Close() End If ' Create a new file in C:\\ dir Dim textWriter As XmlTextWriter = New XmlTextWriter(Application.StartupPath & "\flv.xml", Nothing) ' Opens the document textWriter.WriteStartDocument() ' Write comments 'textWriter.WriteComment("First Comment XmlTextWriter SampleExample(") 'textWriter.WriteComment("myXmlFile.xml in root dir") ' Write first element textWriter.WriteStartElement("Videos") ' Write next element textWriter.WriteStartElement("video", "") 'textWriter.WriteString("Student") 'find and replace \ with / for flash sReplaceChar = (openFileDialog1.FileName) sReplaceChar = Replace(sReplaceChar, "\", "/") textWriter.WriteString(sReplaceChar) textWriter.WriteEndElement() ' Ends the document. textWriter.WriteEndDocument() ' close writer textWriter.Close() 'showckwave movie 'AxShockwaveFlash1.Movie(App.Path & "\XML_FLV_player.swf") AxShockwaveFlash1.Movie = Application.StartupPath & "\XML_FLV_player.swf" End Sub




Reply With Quote