Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

Creating Flash File Player in Visual Basic.Net (VB.Net)

Author: DevASP
Download Source Code : 522_Flash_player.zip

How you can load the flash file from your hard disk to your VB.Net form and perform some flash move controls like Play, Stop, Rewind and Forward on the specific move.

create a new project in vb.net Right click on the tool box. Select “Add/Remove Items". Select “COM Components” Select “Shockwave Flash Object”. Click OK. Then you can see the Shockwave Flash Object in the tool bar. Drag this tool and five buttons on the form.

Double click on the from and write the following code on the from load event

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Button2.Text = "Load"

        Button1.Text = "Stop"

        Button3.Text = "Rewind"

        Button4.Text = "Forward"

    End Sub

Now double click on the button2 and write the following code on button click event

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        Dim open As New OpenFileDialog

        open = New OpenFileDialog

        open.Filter = "Image Files(*.swf)|*.swf"

        If (open.ShowDialog() = DialogResult.OK) Then

            AxShockwaveFlash1.Movie = open.FileName

        End If

 

    End Sub

Now double click on the button1 and write the following code on button click event

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        If Button1.Text = "Stop" Then

            Button1.Text = "Play"

        ElseIf Button1.Text = "Play" Then

            Button1.Text = "Stop"

        End If

        AxShockwaveFlash1.Play()

 

    End Sub

Now double click on the button2 and write the following code on button click event

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        AxShockwaveFlash1.Rewind()

    End Sub

Now double click on the button4 and write the following code on button click event

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

        AxShockwaveFlash1.Forward()

    End Sub

 

Article Comments
Fantastic, it is exactly what I was looking for. My first interest was integrating OpenGL with VB.Net but seeing what can be done in actionscript, I needed only something like this example, simple and with the source. Cheers!

Posted on 2/27/2007 7:51:56 AM by Oliver

i want the coading of animation make in vb.net,c sharp & asp.net

Posted on 5/1/2007 1:28:54 PM by hardik

Hi Sir...
I add the Control in the ToolBar. But while dragging it into my form, I got 'Failed to import ActiveX Control.Please ensure it is properly registered'. I dont know what to do.. Please guide me.

Posted on 5/24/2007 7:45:02 AM by Praveena

"I add the Control in the ToolBar. But while dragging it into my form, I got 'Failed to import ActiveX Control.Please ensure it is properly registered'."

Solution: Save project first.

Posted on 9/14/2008 8:45:01 PM by Gary

i want the coding of animation make in vb.net,asp.net
i add the control in the flash player.

Posted on 11/15/2008 10:35:41 PM by bhargav

thank you my dear...

Posted on 11/25/2009 6:48:16 AM by krishnaa...

Sir,
Can u guide how to create media player in vb.net web application. im beginner in vb.net. Thank you.

Posted on 12/2/2009 3:15:35 AM by Devan

Hi Devan,

Please see this link
http://www.devasp.net/net/articles/display/304.html

Thanks.

Posted on 12/2/2009 3:58:55 AM by zunnair

Hi devasp,
its a very good tut but i have 1 problem. everytime i use the shockwave flash object it gives an error and it says "InvalidOperationException was unhandled" what does this mean? and how can i fix it? i have too the legal and registererd version of visual basics 2008.

Posted on 4/6/2010 10:16:35 AM by Huibhuibhuibb

When I put in the control and the code, it works on one computer and doesn't work on the other.

Posted on 4/17/2010 8:53:02 AM by Frank

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< Creating Drag and Drop Events Using Tree View Control

Disclaimer - Privacy
© 2002-2017 DevASP.net