-
FScommand does nothing VB 2005
I have added a Shockwave Flash Object to a form in VB 2005 express. Works fine. It is called axShockwaveFlash1.
Now I try and use FSCommands with this, so I did a google search, and found some stuff that says i need to create a sub [my component]_FSCommand. SO I add this:
Private Sub axShockwaveFlash1_FSCommand(ByVal command As String, ByVal args As String)
and it is not called when I run an fscommand in flash. Why not?
-
First, the FSCommand() method should have the following structure:
-Note: My flash object is called oFlash -
Private Sub oFlash_FSCommand(ByVal sender As Object, ByVal e As AxShockwaveFlashObjects._IShockwaveFlashEvents_FSC ommandEvent) Handles oFlash.FSCommand
End Sub
The FSCommand method only listens for fscommand(command:String, args:String=):void command from the Flash movie that is loaded into the .Net environment and is very useful for passing information to .Net from the Flash movie.
You can retrieve the information passed to .Net using e.args to retrieve the data.
Private Sub oFlash_FSCommand(ByVal sender As Object, ByVal e As AxShockwaveFlashObjects._IShockwaveFlashEvents_FSC ommandEvent) Handles oFlash.FSCommand
MsgBox(e.args) 'for a quick view of what is passed into the .Net environment
End Sub
For passing string data back to the Flash movie, the SetVariable method should be used - oFlash.SetVariable(name as String, value as String); however, I have been unable to pass data back to the Flash movie. I have built the movie with Flex 3 so I don;t know if this is a Flex issue or a Flash issue.
-
Tim (Super Moderator)
setVariable sets/creates variables under global, which doesn't exist in AVM2 so the variables you are creating are only available to AVM1. If you publish your SWF as Flash 8 then you will be able to access them. For AS3/AVM2 you should use ExternalInterface instead of FSCommand because that will let you return data easily.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|