How can i insert a flash animation, swf file on my VB 6 form ?
Thanks ...
Printable View
How can i insert a flash animation, swf file on my VB 6 form ?
Thanks ...
There are a few ShockWave Flash controls. I like swFlash.ocx, more likely than not you should find it in your VB components.
Shockwave flash component.
If you have shockwave onyour system then get it from your toolbox
Then add it to a form then just do:
command1_Click()
ShockwaveFlash1.Movie = "http://www.miniclip.com/games/samurai-sam/en/samuraisam.swf"
I have Flash9b.ocx. What's the difference between that and swFlash.ocx and how do you use it?Quote:
Originally Posted by Milk
Add it to your toolbox and put it on a form. I also use Flash9b.ocx., don't know about the other one. Then run the code i showed before:Quote:
Originally Posted by jmsrickland
command1_Click()
ShockwaveFlash1.Movie = "http://www.miniclip.com/games/samurai-sam/en/samuraisam.swf"
I have Flash.ocx, Flash9d.ocx and SwFlash.ocx on my system and they all work the same. Its just the version of ShockWave you have installed. I have 6, 7, 8 and 9 installed.Quote:
Originally Posted by jmsrickland
Anyway to play a swf movie you can use a CommonDialog to find the movie or just use this. ;)
You can always search on here. This as been talked about many times. :)Code:Private Sub cmdPlay_Click()
ShockWave1.LoadMovie 1, App.Path & "\Your.swf"
ShockWave1.Movie = App.Path & "\Your.swf"
'ShockWave1.GotoFrame 1 'not really needed here
End Sub
'Menu item for play and pause
Private Sub mnuPlay_Click()
Select Case mnuPlay.Caption
Case "&Play"
ShockWave1.Playing = True
mnuPlay.Caption = "&Pause"
Case "&Pause"
ShockWave1.Playing = False
mnuPlay.Caption = "&Play"
End Select
End Sub
I am reviving this thread for a good reason...
I am currently trying to learn how to play a SWF animation file, but I have encountered some problems:
The actual images are supposed to show, but instead all I get is a white background. Is there any way for the animation to function properly with no problems?
I am attaching the file folder. If somebody could let me know where I went wrong, please let me know. :)
Scratch that, I figured it out myself. Thanks anyway for your help. :)
what was the solution?
I got it to work too, change 1, to 0,
I can't even save the project. BTW: The name of the shock player is incorrect.
Yeah, I just ran into that issue, I am unable to save the form now that I have the shockwave component on it. Do you know why?
No, I don't have the slightest idea why but I have another project that has the same exact control on it and I have no problems saving it and it plays as well as this project.
I even tried loading a new copy of the control. Same problem. It must be the control if you try to add another (like a button) control to the project.
As a matter of fact, any changes code or adding buttons will cause it to error out upon save
It's definitely the OCX.