Flash 与 VC 通讯
//Flash AS3.0
创建动态文本框 实例名称:textvcmsg
创建按钮控件 实例名称:button1
图层1帧1脚本
//VC发送到Flash方法m_flash.CallFunction(“
import flash.external.*;
ExternalInterface.addCallback(“MsgBox”, this. MsgBox);
function MsgBox(msg:String)
{
textvcmsg.text = msg;
}
//flash发送到VC
// movie clip button control
button1.addEventListener(MouseEvent.CLICK, clickHandler);
function clickHandler(event:MouseEvent):void {
fscommand(“MsgBox”, “这是flash调用c++的响应”);//flash发送方法
}
//VC 2008
添加Flash控件
添加Flash控件事件处理函数FSCommandShockwaveflash1
OnInitDialog函数添加
m_flash.MoveWindow(570,0, 600, 800);//(0,0,600,768);// //FLASH位置大小
m_flash.LoadMovie(0, exePath + “test.swf”);
m_flash.Play();
void CWinSockServerDlg::FSCommandShockwaveflash1(LPCTSTR command, LPCTSTR args)
{
if( 0 == _tcscmp(command,_T(“MsgBox”)))
{
AfxMessageBox(args);//弹出Flash发来的消息
}
}
还没有评论,来说两句吧...