Results 1 to 6 of 6

Thread: FLASH + VB question...

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Location
    philippines
    Posts
    245

    Question FLASH + VB question...

    How can i send a command from VB to flash. I want to let vb tell flash that when m cursor is over my button my flash button will glow. I've already created my flash and exported it to swf format.

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: FLASH + VB question...

    This highlights the command button it is over. You may want it to highlight something else. Just change it from Command1.BackColor = vbCyan
    to whatever you want.

    VB Code:
    1. Option Explicit
    2. Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
    3. Private Declare Function ReleaseCapture Lib "user32" () As Long
    4. Private Declare Function GetCapture Lib "user32" () As Long
    5. ' Button must be set to Graphical!
    6.  
    7. Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    8. If (X < 0) Or (Y < 0) Or (X > Command1.Width) Or (Y > Command1.Height) Then
    9.      ReleaseCapture ' the mouse is no longer over the button, change backcolor to gray
    10.      Command1.BackColor = &H8000000F
    11. ElseIf GetCapture() <> Command1.hwnd Then
    12.     SetCapture Command1.hwnd ' the mouse is over the button, change backcolor to cyan
    13.     Command1.BackColor = vbCyan
    14. End If
    15. End Sub

  3. #3
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: FLASH + VB question...

    Quote Originally Posted by dglienna
    This highlights the command button it is over. You may want it to highlight something else. Just change it from Command1.BackColor = vbCyan
    to whatever you want.

    VB Code:
    1. Option Explicit
    2. Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
    3. Private Declare Function ReleaseCapture Lib "user32" () As Long
    4. Private Declare Function GetCapture Lib "user32" () As Long
    5. ' Button must be set to Graphical!
    6.  
    7. Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    8. If (X < 0) Or (Y < 0) Or (X > Command1.Width) Or (Y > Command1.Height) Then
    9.      ReleaseCapture ' the mouse is no longer over the button, change backcolor to gray
    10.      Command1.BackColor = &H8000000F
    11. ElseIf GetCapture() <> Command1.hwnd Then
    12.     SetCapture Command1.hwnd ' the mouse is over the button, change backcolor to cyan
    13.     Command1.BackColor = vbCyan
    14. End If
    15. End Sub
    dG, that looks like it has nothing to do with the question, or is it just me


    Has someone helped you? Then you can Rate their helpful post.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Location
    philippines
    Posts
    245

    Re: FLASH + VB question...

    hehehe you are right manavo11.. but thanks anyway for the effort dglienna...

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: FLASH + VB question...

    Does this help?

  6. #6
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913

    Re: FLASH + VB question...

    Check out my sample app http://www.planet-source-code.com/vb...14739&lngWId=1

    You can look in the code on how to send data to the flash movie and read it with Actionscript in Flash.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

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