First make sure your shockwaveflash contol is called "swf"
Now add this code:
PHP Code:
Private Sub swf_FSCommand(ByVal command As String, ByVal args As String)
On Error Resume Next
'MsgBox (command)
'Exit Sub
'Call Form1.SetFocus
DoEvents
gridx = swf.GetVariable("_level0.mcBoard.mcPiece0_0.pGameController.gridUnitX")
gridy = swf.GetVariable("_level0.mcBoard.mcPiece0_0.pGameController.gridUnitY")
temper = command
temp = Replace(temper, "_level0.mcBoard.mcPiece", "")
temp2 = Split(temp, "_")
PuzzleLeftToRight = temp2(0)
PuzzleUpToDown = temp2(1)
DoEvents
temp3 = 64
Call swf.SetVariable(temper & "._x", PuzzleLeftToRight * gridx)
Call swf.SetVariable(temper & "._y", PuzzleUpToDown * gridy + 30)
End Sub
Now open macromedia flash and make a new .fla project insert this code:
PHP Code:
var _loc3 = 0;
while (_loc3 < _level0.gGameController.piecesArr.length)
{
FSCommand(_level0.gGameController.piecesArr[_loc3]);
++_loc3;
}
publish this file and call it test.swf and put it in the same folder as ur vb6 project files.
Now add a command button to ur project that we will use to solve the game add this code:
PHP Code:
Call swf.LoadMovie(99, App.Path & "\test.swf")
Done
