vb.net 与falsh互相通讯

flash按钮传数据给vb.net

flash制作一个按扭,将按扭拖到场景中,并命名"button_but",在按扭所在的场景中的第一帖加如下代码

button_but.onPress=function(){
fscommand("gogo","123");
};

gogo:为vb.net中要调用的函数

123:要传给vb,net的值 

vb.net中

 '加载影片

 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        AxShockwaveFlash1.Movie = Application.StartupPath & "/test.swf"
    End Sub

'点击按钮调用的函数

 Private Sub gogo(ByVal sender As Object, ByVal e As AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent) Handles AxShockwaveFlash1.FSCommand
        TextBox1.Text = e.args.ToString()
    End Sub

--------------------------可以加我微信号:googlecao 进行交流------------------------

vb.net传值给flash

flash场景中建名为label1的文本框

vb.net代码如下

 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        AxShockwaveFlash1.SetVariable("label1.text", "这是从VB那儿来的的")
    End Sub



你可能感兴趣的:(VB.NET)