Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


flash & vb integration sample


flash & vb integration sample

Author
Message
softprotect
softprotect
Forum God
Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)

Group: Forum Members
Posts: 3, Visits: 7
this is a flash & vb integration sample

to teach you advanced manipulation between VB & Flash.

if you anderstand this project you will able to create a real flash desktop application and flash game with joystick support.



FlashVars.zip



FlashVars:

will teach you (calFunction) vb & flash manipulation



download [url=http://www.a1vbcode.com/app-5663.asp[/url]

Keithuk
Keithuk
Forum God
Forum God (154K reputation)

Group: Moderators
Posts: 1.9K, Visits: 5.5K
Welcome to A1vbcode.

Not a good download link you've shown.

Flash & VB Integration

You haven't even put the Flash Player on the Form. In readme first.txt you say before run the project add flash object to the form.

You haven't used Option Explicit in the JoyControl.frm there are errors.

Keith

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

softprotect
softprotect
Forum God
Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)

Group: Forum Members
Posts: 3, Visits: 7
thank u for replay

how can i reupload the zip file?



Edited
7/8/2013 by softprotect
softprotect
softprotect
Forum God
Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)Forum God (923 reputation)

Group: Forum Members
Posts: 3, Visits: 7
thank u for replay

how do i can reupload the zip file, or edit ?



>> You haven't even put the Flash Player on the Form. In readme first.txt you say before run the project add flash object to the form.



when u add latest version of flash player and save the project u will get an error.

but if u created EXE file there is no problem with flash object.



but when delete the flash object and save the project there is no problems.



>> You haven't used Option Explicit in the JoyControl.frm there are errors.



fix the form name bug by rename it to (player)



delete the joycontrol form and replace it with this code:



Option Explicit

Private myJoy As JOYINFOEX

Dim r&



Private Sub Form_Load()



Static TheX As Long

Static TheY As Long



' Hide the mouse cursor.

'ShowCursor (False)

' Tell form to receive joystick functions.

r& = joySetCapture(hWnd, JOYSTICKID1, 1, 0)

r& = joyReleaseCapture(JOYSTICKID1)

' Get joystick position coordinates and fill in the TheX and TheY

' variables.

r& = joyGetPosEx(JOYSTICKID1, myJoy)

TheX = myJoy.dwXpos

TheY = myJoy.dwYpos





End Sub



Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)



' Show the mouse cursor.

'ShowCursor (True)





End Sub



Private Sub Form_Resize()



' Disable the timer.

'If Form1.WindowState = 0 Then Timer1.Enabled = False





End Sub



Private Sub Form_Terminate()



' Show the mouse cursor.



ShowCursor (True)



End Sub



Private Sub Form_Unload(Cancel As Integer)



' Show the mouse cursor.



ShowCursor (True)



End Sub



Private Sub Timer1_Timer()



myJoy.dwSize = 64

myJoy.dwFlags = JOY_RETURNALL

' Get the joystick coordinates.

r& = joyGetPosEx(JOYSTICKID1, myJoy)

' If a joystick's button is pressed, put the number of the button in

' label4.

If myJoy.dwButtons > 0 Then

' Label4.Caption = myJoy.dwButtons

'JOY_Buttons

player.ShockwaveFlash1.SetVariable "JOY_Buttons", myJoy.dwButtons

Else 'NOT MYJOY.DWBUTTONS...

player.ShockwaveFlash1.SetVariable "JOY_Buttons", vbNullString

End If

' Fill the textboxes with the joystick coordinates.



Text1.Text = myJoy.dwXpos / 1000

Text2.Text = myJoy.dwYpos / 1000

Select Case Mid$(Text1, 1, 2)

Case "32"

'_level0.__joyRL



player.ShockwaveFlash1.SetVariable "_level0.__joyRL", vbNullString

Case "65"

player.ShockwaveFlash1.SetVariable "_level0.__joyRL", "65"

Case "0"

player.ShockwaveFlash1.SetVariable "_level0.__joyRL", "0"

End Select

Select Case Mid$(Text2, 1, 2)

Case "32"

'_level0.__joyUD

player.ShockwaveFlash1.SetVariable "_level0.__joyUD", vbNullString

Case "65"

player.ShockwaveFlash1.SetVariable "_level0.__joyUD", "65"

Case "0"

player.ShockwaveFlash1.SetVariable "_level0.__joyUD", "0"

End Select



End Sub







GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search