Option Explicit
Private Function CreateDOM()
Dim dom
Set dom = New DOMDocument30
dom.async = False
dom.validateOnParse = False
dom.resolveExternals = False
dom.preserveWhiteSpace = True
Set CreateDOM = dom
End Function
'Private Sub Command1_Click()
' ShockwaveFlash1.Movie = App.Path & "\XML_FLV_player.swf"
'End Sub
Private Sub File1_Click()
Dim dom, node, frag, cd, attr
Dim sReplaceChar As String
sReplaceChar = ""
'On Error GoTo ErrorHandler
Set dom = CreateDOM
' Create a processing instruction targeted for xml.
Set node = dom.createProcessingInstruction("xml", "version='1.0' encoding='UTF-8'")
dom.appendChild node
Set node = Nothing
' Create a comment for the document.
Set node = dom.createComment("sample xml file created using XML DOM object.")
dom.appendChild node
Set node = Nothing
' Create the root element.
Dim root
Set root = dom.createElement("videos")
' Add the root element to the DOM instance.
dom.appendChild root
' Insert a newline + tab.
root.appendChild dom.createTextNode(vbNewLine + vbTab)
' Create and add more nodes to the root element just created.
' Create a text element.
Set node = dom.createElement("video")
'find and replace \ with / for flash
sReplaceChar = (File1.Path & "\" & File1.FileName)
sReplaceChar = Replace(sReplaceChar, "\", "/")
'node.Text = "some character data"
'node.Text = File1.Path & "/" & File1.FileName
node.Text = sReplaceChar
'MsgBox (node.Text)
' Add text node to the root element.
root.appendChild node
Set node = Nothing
' Add a newline plus tab.
root.appendChild dom.createTextNode(vbNewLine + vbTab)
' Save the XML document to a file.
dom.save App.Path + "\flv.xml"
Set root = Nothing
Set dom = Nothing
' Unload frmhome
' Load frmhome
' frmhome.Show
'AxShockwaveFlash1.LoadMovie(1, Application.StartupPath & "\XML_FLV_player.swf")
'AxShockwaveFlash1.Movie = Application.StartupPath & "\XML_FLV_player.swf"
'Me.AxShockwaveFlash1.GotoFrame (1)
'Me.AxShockwaveFlash1.StopPlay()
Call ShockwaveFlash1.LoadMovie(1, App.Path & "\XML_FLV_player.swf")
ShockwaveFlash1.Movie = App.Path & "\XML_FLV_player.swf"
Me.ShockwaveFlash1.GotoFrame (1)
Me.ShockwaveFlash1.StopPlay
frmhome.txtInfo.Text = ""
'frmshockwave.Caption = frmhome.File1.FileName
'load shockwave form
'Unload frmshockwave
' Load frmshockwave
'frmshockwave.Show
Exit Sub
ErrorHandler:
MsgBox Err.Description
End Sub
'search for flv file
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
File1.Pattern = "*.flv"
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = 0 Then
Dim Msg ' Declare variable.
'Set the message text.
Msg = "Do you really want to exit?"
'If user clicks the No button, stop QueryUnload.
If MsgBox(Msg, vbQuestion + vbYesNo, Me.Caption) = vbYes Then
Call closeAllForms
'Unload frmIntro
Cancel = False
Else
Cancel = True
End If
End If
End Sub
Private Sub ShockwaveFlash1_FSCommand(ByVal command As String, ByVal args As String)
If (command = "info") Then
'frmhome.txtInfo.Text = (args)
frmhome.txtInfo.Text = frmhome.txtInfo.Text & args & vbNewLine
Else
MsgBox (args)
End If
' If (command = "video") Then
' frmhome.txtInfo.Text = frmhome.txtInfo.Text & args & vbNewLine
' Else
' MsgBox (args)
' End If
'
End Sub