Flash in VB (Using Visual Studio 2005) in 3 not so easy steps

thirteentwenty

Well-known member
Joined
Oct 9, 2008
Messages
80
Location
Honolulu
Programming Experience
Beginner
I've seen a few posts on how to get flash movies into (on to?) a form... Here's how I did it...

  1. Add the component to your toolbox :
    I expanded the "All windows Forms" option, then right clicked in it and selected the "Choose Items..." option
    Then select the "COM Components" Tab and scroll down until you see "Shockwave ActiveX Control" and "Shockwave Flash Object" (Note: I had 2 of each so I just selected the new of the two). If they are missing surf on over to and download the new player and pick install the viewer... repeat the above steps if you needed to install =)

  2. Add the component to your form :
    Take the newly added tool in your tool box and drag it on to your form...

    If you get the following error "Failed to import the ActiveX control. Please ensure it is properly registered. Just rebuild, click Build, click Rebuild > Solution... Once i had to restart VS2005 (but that was only once).

    You should then be able to drag the component to your form...

  3. Add the movie :
    In the properties of that component scroll down until you see "Movie", in this field put the complete path to your movie. I had to do this even though I had added it as a resource...

    Make sure that the dimensions for the component are the same as the movie when it was built in flash other wise it'll come out skewed funniely... yea I just used a made up word =OP

    Note: one problem that I ran into was that the property for the movie called "Playing" would not save as "True" the workaround (or perhaps the proper way of doing it) is to add this bit of code to your load event.

    VB.NET:
            With [B]AxShockwaveFlash1[/B]
                .Stop()
                .Play()
            End With
    * the bolded text in the code should be changed to what ever you named the movie instance...

heh... the funny thing is that I had to learn this because my boss wanted a bit of flash in the about window... anyways...

I've attached a zip with my source to a quick and dirty... hopefully it works for everyone...
 

Attachments

  • flashtest.zip
    18.3 KB · Views: 24
Last edited by a moderator:
Back
Top