Hi,
I have a project in VB 2005 and I have inserted a flash movie (.swf), the item from the vb toolbox ax shockwave flash active x object returned an error "error activex make sure it is properly registered" so I create one through code :

Imports AxShockwaveFlashObjects.AxShockwaveFlash
Public Class Form3
    Dim webAddress As String = "http://www.vbforfree.com"
    Dim flash As New AxShockwaveFlash

Now I loaded the flash movie and send a variable to flash through Visual Basic
code :

Private Sub Form3_keydown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        Me.Focus()
        If e.KeyCode = Keys.D6 Then
            a = a + 10
flash.SetVariable("/:playerbalance", a)

Everything OK but when I try to send from flash to VB I get nothing
flash code :

on (press)
{
    	fscommand("flashMessage", "Hi C-Sharp");
	}

VB code to receive variable code :

Private Sub flash_FSCommand(ByVal sender As Object, ByVal e As AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent)
        If (e.command = "flashMessage") Then
            RichTextBox1.AppendText(e.args + "\n")
        End If

    End Sub

flash is the dim for the shockwaveflash activex object.
When I managed once to drag a shockwaveflash from toolbox once I succed it worked but now I don't know if there is a special property to add to the code created flash object to make it receive vars. Help please.

Kyriakos

This article has been dead for over six months. Start a new discussion instead.