FlashCommand arguments

Fritz

Freshman
Joined
Oct 6, 2002
Messages
40
Location
switzerland
I know it is rather difficult, that somebody can tell me about this.

I have a form and a Flash movie running on it. The movie sends an FSCommand to the form and the form receives the command. Up to here everythings working fine. The problem is how to interpretate the parameters (Strings) which the FSCommand passes to the VB-form. The first pm should just tell where to put the message (textfield1.text) and the second is to pass the value to be inserted.

In VB6 the thing was running without problems like that:

Flash FSCommand for VB6:

on (release) {
fscommand("txtPoints", "OK");
}

Corresponding code in VB6:

Private Sub Flash1_FSCommand(ByVal command As String, ByVal args As String)

Select Case command
Case "txtPoints"
txtPoints= args
End Select

End Sub

And this worked perfectly.

Now FSCommand for VB.Net:

on (release) {
fscommand("txtPoints.Text", "OK");
}

And the Sub in VB.Net should be something like this:

Private Sub Flash1_FSCommand(ByVal sender As Object, ByVal e As AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent) Handles Flash1.FSCommand

// Here must be some declarations! But that's what I don't get to the point!

If Command = "txtPunkte.Text" Then
Select Case args
Case "txtPunkte.Text"
txtPunkte.Text = args
End Select
End If
End Sub

So nothing happens when I press the FSCommand-button in Flash.

But at the other hand, if I only put:

Private Sub Flash1_FSCommand(ByVal sender As Object, ByVal e As AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent) Handles Flash1.FSCommand

'txtPunkte.Text = "OK"

End Sub

That will work and it inserts "OK" into the Textbox.

I mean I could live with that, but I woul prefer to be able to send various types of commands. Can anybody tell me how to declare these parameters?
 
The command and args that would normally be passed will probably be members of the e that is passed to the function. Type e. and see what members are listed. I'm surprised the code didn't cause an error since you were trying to refer to "args" which doesn't exist. Maybe you turned Option Explicit off or something.
 
Thats it!! Thank you.

If I type e. the dropdown lists

e.arg
e.command
e.GetType

I think I can figure the rest out. I have tried things already with that "e", but somehow I never put a point on it.

Ok. I'll put the final code here when its done.

Thanks, divil
 
That was reallx silly. Just had to put

Me.txtPunkte.Text = e.args /right

instead of

txtPunkte.Text = args /wrong


And thats much better, then I thought, because with this I can use the other parameter (e.command) to transmit another message at th same time. Very nice.
 
Back
Top