Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[VB.NET] - Integrate Flash Into Your Application - [TUT]
#1
Just a quick tutorial on how to integrate .SWF files into your VB.NET applications using the Shockwave Flash Object component.

This is very simple to do and it's really quite useful to know.

You need to start off by adding the component. To do this, right click on "All Windows Forms" in your Toolbox, and select "Choose Items".

[Image: 1fmf.png]

On the pop-up window, select the COM tab, and scroll down to Shockwave Flash Object. Check the box next to it, and click OK.

[Image: 2njn.png]

Now find the Shockwave Flash Object in your Toolbox, and drag it onto your form. Now you just need to get it to play something! For this example I will simply add an OpenFileDialog, which will be used to select the the .SWF file, and open it in the Shockwave Flash Player. Note you can also link directly to an .SWF URL in the same way.

Code:
Dim OFD As New OpenFileDialog
        OFD.Filter = "SWF Files (*.swf)|*.swf|All files (*.*)|*.*"
        Dim results As DialogResult
        results = OFD.ShowDialog

        If results = DialogResult.OK Then
            AxShockwaveFlash1.Movie = OFD.FileName
        End If

And there you have it..
Reply
#2
Anybody got any comments on this?

It's not much but it's a pretty useful tutorial which can be used for quite a lot of things.
Reply
#3
That's pretty cool, I can think of quite a few things I can do with something like this ^^
[Image: komnewsig.png]
Reply
#4
Yeh I've been playing around with this quite a bit. It would be a useful way of creating some sort of game engine, which is what I'm working on at the minute.
Reply
#5
Very detailed tutorial. In addition, you can find the direct .swf file of a flash file (e.g. game) and set the direct url as the movie instead of a local file.
Reply
#6
Shortened your code:
Code:
Dim OFD As New OpenFileDialog
        OFD.Filter = "SWF Files (*.swf)|*.swf|All files (*.*)|*.*"
        Dim results As DialogResult = OFD.ShowDialog

        If results = DialogResult.OK Then
            AxShockwaveFlash1.Movie = OFD.FileName
        End If

Other than that, it's all good, but you should put a mention that you can link to the location of a flash object via url as well, if you find the source ID link. Basically what Blic already stated.
Reply
#7
I thought that was quite obvious but I'll add it anyway. Thanks for the feedback.
Reply
#8
Another easy tutorial, Thanks you are great.
Reply
#9
I just started learning a little bit of flash to, nice tut.
~ Digital-Punk
Reply
#10
(08-25-2011, 06:14 PM)algorithm Wrote: I just started learning a little bit of flash to, nice tut.

If you know how to code in Flash then you can really do some amazing stuff with the SWF COM.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to hook the keyboard. [VB.NET] [TuT] Vorfin 92 60,813 09-23-2019, 11:55 AM
Last Post: Jamimartin
  VB.NET Port Scanner [TUT] Fragma 30 14,413 11-27-2012, 11:26 PM
Last Post: ƃu∀ ıʞƃu∀
  [TUT] MD5 Encrypter & Finder [VB.NET] Fragma 12 7,836 11-25-2012, 10:36 PM
Last Post: ƃu∀ ıʞƃu∀
  [TUT] How to make a simple WebBrowser in VB 2010! [TUT] - [ Pictures] Statics 95 61,739 10-07-2012, 06:56 AM
Last Post: a99
  Application Organiser lhcrulz 3 2,708 02-11-2012, 08:56 PM
Last Post: AceInfinity

Forum Jump:


Users browsing this thread: 2 Guest(s)