PDA

Click to See Complete Forum and Search --> : VB6.0 - Basic Flash Player


Nightwalker83
Feb 18th, 2010, 12:57 AM
Hi,

Here is a basic flash player I made in VB6.0 you can download the source code below.

Below is the current code!


'By Aaron "Nightwalker83" Spehr
Dim n As Integer

Private Sub File1_Click()
File1.Drag
End Sub

Private Sub Form_Load()
'Set the background colour, etc
Me.BackColor = &H80000008
Me.BorderStyle = Sizable
File1.Pattern = "*.swf"
File1.DragMode = 0
End Sub

Private Sub Form_Unload(Cancel As Integer)
'Close the program
Unload Me
End
End Sub

Private Sub ShockwaveFlash1_DragDrop(Source As Control, X As Single, Y As Single)
'This loads the movie
Call ShockwaveFlash1.LoadMovie(0, File1.Path + "\" + File1.FileName)
End Sub


Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub

Private Sub Drive1_Change()
On Error GoTo err:
Dir1.Path = Drive1.Drive
Exit Sub
err:
MsgBox ("Please choose another drive!")
End Sub


I can't get the keyboard to interact with the flash control. However, I have noticed that if the screen is big enough you can use the control inside the flash movie to start, stop, etc.

Check link below for any problems relating to getting the project to work correctly.

Nightwalker

Edit:

Just a word of warning though, use the above code with flash 10e or earlier, the other versions of flash 10 seem to have problems which, can be talked about in this thread (http://www.vbforums.com/showthread.php?t=638317).

Nightwalker83
Jan 15th, 2011, 05:22 AM
I have created the code below to re-size the player and also player online shockwave flash files.


Private Sub Command1_Click()
'15/01/2011
' Play a streaming video
' The base url
ShockwaveFlash1.Base = "http://www.mysite.com/Nights%20Hell%20Hole/"
'URL leading the actual movie file
ShockwaveFlash1.Movie = "http://www.mysite.com/Nights%20Hell%20Hole/media/media.swf"
Call ShockwaveFlash1.Play
End Sub

Private Sub Form_Resize()
'15/01/2011
'Resize the the shockwave flash player
ShockwaveFlash1.Height = Me.Height
ShockwaveFlash1.Width = Me.Width
End Sub

Nightwalker83
Oct 3rd, 2011, 07:23 PM
This code allows you to move the animation to the frame specified:


'Replace "2" with the frame number you want the animation to jump to.
Private Sub cmdGoto_Click()
Call ShockwaveFlash1.GotoFrame(2)
End Sub

dilettante
Oct 9th, 2011, 03:23 PM
The source you give for that flash.ocx is violating Adobe's licensing terms (http://www.adobe.com/products/players/fpsh_distribution1.html).

Basically in order to use Flash as a user, you must download and run the full installer package. To redistribute Flash you must apply for a license to do so, and then you still must give the user the whole install package and they must run it and go through the setup user interface.

Silent installs of all or part of Flash violates the licensing terms.

DavesChillaxin
Nov 8th, 2011, 01:57 PM
The source you give for that flash.ocx is violating Adobe's licensing terms (http://www.adobe.com/products/players/fpsh_distribution1.html).

Basically in order to use Flash as a user, you must download and run the full installer package. To redistribute Flash you must apply for a license to do so, and then you still must give the user the whole install package and they must run it and go through the setup user interface.

Silent installs of all or part of Flash violates the licensing terms.

...and that's why flash fails. :p