[VB.NET] SWF Button?

Experienced Elementalist
Joined
Jun 30, 2008
Messages
256
Reaction score
1
Hey all Coders! :D

I am trying to make a button with SWF, and by that, I mean that I want my button to be a SWF/Flash file. Like, when your mouse is on it, it change color, and press it, change color, or something. I already have my SWF Button, I just want it to be able to do the same stuff as a normal button. Like, I can write MsgBox("Whatever..") in its code. So it will actually become a button, just with some flash in it.

Is that posible? I have been googling around, and I checked it all, and I did not find anything usefull..


Please, dont come with a Use Google answer, because
I ALREADY DID THAT!

Thank you :D
 
What program did you design the .swf file with?

If using Macromedia/Adobe Flash a .html file should be produced when you "publish" it with all the code required to place the flash file where you chose to on the page.

You should be able to copy and paste that into your original .html file and it should show up.

As for the using it as a hyperlink....the on(release, keyPress <Enter>) gotoURL("www.ragezone.com") scripts are what you need....

As for the color changing properties using the on (rollOver) gotoAndPlay(whatever frame number) should control any color changing you have to do.

Hope this helps....I'm new to the Flash scene and think I know what I am talking about here LOL
 
What program did you design the .swf file with?

If using Macromedia/Adobe Flash a .html file should be produced when you "publish" it with all the code required to place the flash file where you chose to on the page.

You should be able to copy and paste that into your original .html file and it should show up.

As for the using it as a hyperlink....the on(release, keyPress <Enter>) gotoURL("www.ragezone.com") scripts are what you need....

As for the color changing properties using the on (rollOver) gotoAndPlay(whatever frame number) should control any color changing you have to do.

Hope this helps....I'm new to the Flash scene and think I know what I am talking about here LOL

Hmm.. Thanks for the advice :D

well, since I dont wanna waste loads of time in front of the Adobe Flash program, I just have a software to make the buttons for me. LAWL!

I saw some way in.. Argh, dunno what VB version it was. I just know the label said 7.1 when I tried to open it, and it converted it to 9.0/.NET Framework 3.5 and it worked. But tthere were a way to add the swf file to the form, but I cant find the way in 9.0.. xD
 
Here you go. - It is fully commented.

15 second job:

http://www.sendspace.com/file/q3dw5p

Or if you're a lazy fuck ;P:

Code:
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Button1.BackColor = Color.Chocolate 'change color of button to chocolate/brown
        Button1.Text = "Hover to Change Colour!" 'change caption of the button
    End Sub

    Private Sub Button1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseHover
        Button1.BackColor = Color.Red 'change to color of the button to red when the user hovers over the button :P
        Button1.Text = "Click to Change Colour!" 'change caption of the button
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        MsgBox("Monsta.")
    End Sub
End Class
 
Here you go. - It is fully commented.

15 second job:

http://www.sendspace.com/file/q3dw5p

Or if you're a lazy fuck ;P:

Code:
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Button1.BackColor = Color.Chocolate 'change color of button to chocolate/brown
        Button1.Text = "Hover to Change Colour!" 'change caption of the button
    End Sub

    Private Sub Button1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseHover
        Button1.BackColor = Color.Red 'change to color of the button to red when the user hovers over the button :P
        Button1.Text = "Click to Change Colour!" 'change caption of the button
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        MsgBox("Monsta.")
    End Sub
End Class

Thanx! Not exacly what I was looking for, but it sure is cool! :P
 
Back