Results 1 to 16 of 16

Thread: How to insert a flash animation (.swf) on a VB6 form

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2008
    Posts
    11

    How to insert a flash animation (.swf) on a VB6 form

    How can i insert a flash animation, swf file on my VB 6 form ?

    Thanks ...

  2. #2
    Cumbrian Milk's Avatar
    Join Date
    Jan 2007
    Location
    0xDEADBEEF
    Posts
    2,448

    Re: How to insert a flash animation (.swf) on a VB6 form

    There are a few ShockWave Flash controls. I like swFlash.ocx, more likely than not you should find it in your VB components.

  3. #3
    Addicted Member
    Join Date
    May 2007
    Location
    Belgium
    Posts
    156

    Re: How to insert a flash animation (.swf) on a VB6 form

    Shockwave flash component.

  4. #4
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: How to insert a flash animation (.swf) on a VB6 form

    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"
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

  5. #5
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: How to insert a flash animation (.swf) on a VB6 form

    Quote Originally Posted by Milk
    There are a few ShockWave Flash controls. I like swFlash.ocx, more likely than not you should find it in your VB components.
    I have Flash9b.ocx. What's the difference between that and swFlash.ocx and how do you use it?

  6. #6
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: How to insert a flash animation (.swf) on a VB6 form

    Quote Originally Posted by jmsrickland
    I have Flash9b.ocx. What's the difference between that and swFlash.ocx and how do you use it?
    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:
    command1_Click()
    ShockwaveFlash1.Movie = "http://www.miniclip.com/games/samurai-sam/en/samuraisam.swf"
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

  7. #7
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: How to insert a flash animation (.swf) on a VB6 form

    Quote Originally Posted by jmsrickland
    I have Flash9b.ocx. What's the difference between that and swFlash.ocx and how do you use it?
    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.

    Anyway to play a swf movie you can use a CommonDialog to find the movie or just use this.
    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
    You can always search on here. This as been talked about many times.
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  8. #8
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: How to insert a flash animation (.swf) on a VB6 form

    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.
    Attached Files Attached Files

  9. #9
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: How to insert a flash animation (.swf) on a VB6 form

    Scratch that, I figured it out myself. Thanks anyway for your help.

  10. #10
    Lively Member
    Join Date
    Apr 2011
    Posts
    95

    Re: How to insert a flash animation (.swf) on a VB6 form

    what was the solution?

  11. #11
    Lively Member
    Join Date
    Apr 2011
    Posts
    95

    Re: How to insert a flash animation (.swf) on a VB6 form

    I got it to work too, change 1, to 0,

  12. #12
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: How to insert a flash animation (.swf) on a VB6 form

    I can't even save the project. BTW: The name of the shock player is incorrect.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  13. #13
    Lively Member
    Join Date
    Apr 2011
    Posts
    95

    Re: How to insert a flash animation (.swf) on a VB6 form

    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?

  14. #14
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: How to insert a flash animation (.swf) on a VB6 form

    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.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  15. #15
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: How to insert a flash animation (.swf) on a VB6 form

    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
    Last edited by jmsrickland; Jun 15th, 2011 at 02:21 PM.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  16. #16
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: How to insert a flash animation (.swf) on a VB6 form

    It's definitely the OCX.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

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