Results 1 to 4 of 4

Thread: how to update shockwave movie

  1. #1

    Thread Starter
    Fanatic Member Navarone's Avatar
    Join Date
    Jun 2003
    Location
    Akron, Ohio USA
    Posts
    740

    how to update shockwave movie

    I am working on a shockwave player in my VB app. It draws its source from an XML file stored locally. I use a directory and file list box to find the flv file that plays in the shockwave movie. I need a way to refresh the shockwave component so when I click on a new flv file that file plays. This is my code sofar.

    Is there away to refresh the sockwave?

    VB Code:
    1. Option Explicit
    2. 'makes it necessary to specify variables
    3. 'and makes sure no variable used twice
    4.  
    5. Private Function CreateDOM()
    6.     Dim dom
    7.     Set dom = New DOMDocument30
    8.     dom.async = False
    9.     dom.validateOnParse = False
    10.     dom.resolveExternals = False
    11.     dom.preserveWhiteSpace = True
    12.     Set CreateDOM = dom
    13. End Function
    14.  
    15. Private Sub File1_Click()
    16.  
    17.     Dim dom, node, frag, cd, attr
    18.     On Error GoTo ErrorHandler
    19.     Set dom = CreateDOM
    20.    
    21.     ' Create a processing instruction targeted for xml.
    22.     Set node = dom.createProcessingInstruction("xml", "version='1.0' encoding='UTF-8'")
    23.     dom.appendChild node
    24.     Set node = Nothing
    25.    
    26.     ' Create a comment for the document.
    27.     Set node = dom.createComment("sample xml file created using XML DOM object.")
    28.     dom.appendChild node
    29.     Set node = Nothing
    30.    
    31.     ' Create the root element.
    32.     Dim root
    33.     Set root = dom.createElement("videos")
    34.    
    35.     ' Add the root element to the DOM instance.
    36.     dom.appendChild root
    37.     ' Insert a newline + tab.
    38.     root.appendChild dom.createTextNode(vbNewLine + vbTab)
    39.     ' Create and add more nodes to the root element just created.
    40.     ' Create a text element.
    41.     Set node = dom.createElement("video")
    42.     'node.Text = "some character data"
    43.     node.Text = File1.FileName
    44.     ' Add text node to the root element.
    45.     root.appendChild node
    46.     Set node = Nothing
    47.       ' Add a newline plus tab.
    48.     root.appendChild dom.createTextNode(vbNewLine + vbTab)
    49.    
    50.     ' Save the XML document to a file.
    51.     dom.save App.Path + "\flv.xml"
    52.     Set root = Nothing
    53.     Set dom = Nothing
    54.     Exit Sub
    55.    
    56.    
    57. ErrorHandler:
    58.     MsgBox Err.Description
    59. End Sub
    60.  
    61. Private Sub Form_Load()
    62.     'play shockwav movie
    63.     ShockwaveFlash1.Movie = App.Path & "\XML_FLV_player.swf"
    64. End Sub
    65.  
    66. 'search for flv file
    67. Private Sub Drive1_Change()
    68.     Dir1.Path = Drive1.Drive
    69. End Sub
    70.  
    71. Private Sub Dir1_Change()
    72.     File1.Path = Dir1.Path
    73.     File1.Pattern = "*.flv"
    74.  
    75. End Sub
    He who never made a mistake never made a discovery?

  2. #2

    Thread Starter
    Fanatic Member Navarone's Avatar
    Join Date
    Jun 2003
    Location
    Akron, Ohio USA
    Posts
    740

    Re: how to update shockwave movie

    Well, I am not having any luck here. I have tried to refresh the form but that didn't work. There must be away to get the shockwave component to play another movie without restarting the application. Any ideas?
    He who never made a mistake never made a discovery?

  3. #3
    Hyperactive Member
    Join Date
    Apr 2005
    Location
    Indiana
    Posts
    451

    Re: how to update shockwave movie

    I used shockwave for a splash screen in a program I made. You should be able to load in another movie and play it.

    If you have included your shockwave flash component into your toolbox, and added it to your form. The code may look like this.

    Form.ShockwaveFlashControlName.LoadMovie 1, FlashLocation (can be path on pc or url)
    Form.ShockwaveFlashControlName.Movie = FlashLocation
    Form.ShockwaveFlashControlName.GotoFrame 1
    Form.ShockwaveFlashControlName.Loop = False (your preference)
    Form.ShockwaveFlashControlName.Play

    This is the type of code I have used in my application. I am not an expert, but I found this code works for me.

    Hope this helps.

  4. #4

    Thread Starter
    Fanatic Member Navarone's Avatar
    Join Date
    Jun 2003
    Location
    Akron, Ohio USA
    Posts
    740

    Re: how to update shockwave movie

    thanks for the tips, here is what I have and it loads the flvs into my swf perfectly.

    VB Code:
    1. Call ShockwaveFlash1.LoadMovie(1, App.Path & "\XML_FLV_player.swf")
    2.     ShockwaveFlash1.Movie = App.Path & "\XML_FLV_player.swf"

    The only thing is, if there is audio or music in the flash movie, when I load a new movie in the sound doesn't stop, it just keeps going. Eventually I end up with mutiple sound tracks overlaying one another.

    I have run into that before?
    He who never made a mistake never made a discovery?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width