Flash 与 VC 通讯

深碍√TFBOYSˉ_ 2022-07-28 05:19 209阅读 0赞

//Flash AS3.0

创建动态文本框 实例名称:textvcmsg

创建按钮控件 实例名称:button1

图层1帧1脚本

//VC发送到Flash方法m_flash.CallFunction(“这是C++调用flash的响应 “);

import flash.external.*;

ExternalInterface.addCallback(“MsgBox”, this. MsgBox);

function MsgBox(msg:String)

{

  1. 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发来的消息

}

}

发表评论

表情:
评论列表 (有 0 条评论,209人围观)

还没有评论,来说两句吧...

相关阅读

    相关 通讯协议即时通讯

    推送服务一般有三种实现方式: 1.轮询方式 客户端不断的查询服务器,检索新内容。这种方式的缺点十分明显,如果轮询频率过快,会大量消耗网络带宽和电池; 2.长连接