How to play Flash movie (.swf) in vb.net?

  • Thread starter Thread starter Tony555
  • Start date Start date
T

Tony555

Guest
need help with playing .swf file in vb.net? I found 2 flash related components 1) Macromedia Flash Factory Object 2) Shockwave Flash object

which one I should use, and how? any help is appreciated, thanks in advance.
 
hello there tony,

not sure which app you should use but in vb.net you can load any file with its default application by using the following;

system.diagnostics.process.start(yourfilename)

got stuck on this one myself last week...
hope this helps,
drew.
 
You should use the Shockwave Flash object, because you can pass variable from flash to vb.net and vice-versa. In Visual Basic, Visual C++, and other programs that can host ActiveX controls, fscommand() sends a VB event with two strings that can be handled in the environments programming language.
To pass values to vb.net:
Inside the flash movie:
Code:
fscommand("Ordem", "Sair");
Inside vb.net:
Code:
...
string path = System.Environment.CurrentDirectory
path += @"\first.swf"
axShockwaveFlash1.LoadMovie(0,path)
axShockwaveFlash1.Play()
...

 Private Sub FlashPageTurnPri_FSCommand(ByVal sender As System.Object, ByVal e as AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent)
        If (e.command = "Ordem") Then
            
        End If
    End Sub

To pass values to flash:
Code:
Private Sub FlashPageTurnPri_FSCommand(ByVal sender As System.Object, ByVal e as AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent) 
      
   axShockwaveFlash1.SetVariable("mc_mytext.text", "Hello Flash, greetings from .NET")

End Sub

To send data back to the Flash movie you just need to call the SetVariable() method on the Shockwave Flash Object and specify the name of an ActionScript variable or, as in this case, the property of a Flash object.
 
Back
Top