有没有人知道怎样用C++与flas文件进行通信?比如,有个工程,工程中有个IE控件,可以用来显示网面,也可在是flash(flash可以是自己做的),现在flash随机产生个个数据值,他怎样才能把这个数值传出来?

解决方案 »

  1.   

    这个问题我也遇到过,Flash里可以通过FSCommand写个文本文件,VC去读。不了解AS所以但是懂这方面的人太少了。
      

  2.   

    的确是可以通过fscommand来进行通信。但这是flash与其容器flash.ocx的通信,我也是这样做的。不过现在是我不能直接用flash activex控件,我是要用IE来显示网页,当然网页中有自定义的flash文件,现在我估计是IE中自动加载flash控件来显示flash文件,那么现在的问题是怎样得到这个特定的flash控件(容器),其实,这个我是可以通过IHTMLDocment和IHTMLEelement,获是这个flash元素,但我现在却没有办法获得其容器,所以也应无法得到正确的接口IShockwaveFlash,也就无法相应FSComman事件了。
      

  3.   

    </head>
    <body language="javascript" background="Background" onload="return window_onload()" onresize="return window_onresize()">
    <P><FONT face="宋体">
    <TABLE id="Table1" cellSpacing="1" cellPadding="1" width="300" border="1">
    <TBODY>
    <TR>
    <TD>
    <OBJECT id="Shockwaveflash1" style="WIDTH: 280px; HEIGHT: 256px" classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000"
    VIEWASTEXT>
    <PARAM NAME="_cx" VALUE="7408">
    <PARAM NAME="_cy" VALUE="6773">
    <PARAM NAME="FlashVars" VALUE="">
    <PARAM NAME="Movie" VALUE="Background.swf">
    <PARAM NAME="Src" VALUE="Background.swf">
    <PARAM NAME="WMode" VALUE="Window">
    <PARAM NAME="Play" VALUE="-1">
    <PARAM NAME="Loop" VALUE="-1">
    <PARAM NAME="Quality" VALUE="High">
    <PARAM NAME="SAlign" VALUE="">
    <PARAM NAME="Menu" VALUE="-1">
    <PARAM NAME="Base" VALUE="">
    <PARAM NAME="AllowScriptAccess" VALUE="always">
    <PARAM NAME="Scale" VALUE="ShowAll">
    <PARAM NAME="DeviceFont" VALUE="0">
    <PARAM NAME="EmbedMovie" VALUE="0">
    <PARAM NAME="BGColor" VALUE="">
    <PARAM NAME="SWRemote" VALUE="">
    <PARAM NAME="MovieData" VALUE="">
    <PARAM NAME="SeamlessTabbing" VALUE="1">
    </OBJECT>
    </TD>
    <TD>
    <P><STRONG><FONT size="4"><FONT face="宋体"><FONT color="#ff6633">展示</FONT><FONT color="#ffff33">HTML、Flash、.NET</FONT><FONT color="#ff6633">控件通过MFC技术交互作用……</FONT></FONT></FONT></STRONG>
    <STRONG><FONT face="宋体" color="#ff6633" size="4">,</FONT></STRONG><FONT face="宋体" color="#ff6633" size="4"><STRONG>&nbsp;用<FONT color="#ffff33">Flash</FONT>命令显示.NET控件的日历子控件</STRONG></FONT><FONT face="宋体" color="#ff6633" size="4"><INPUT language="javascript" id="Button1" onfilterchange="return Button1_onfilterchange()"
    onblur="return Button1_onblur()" style="WIDTH: 72px; HEIGHT: 24px" onclick="return CallScriptFromHtml()" type="button" value="Press me!" name="Button1"><INPUT language="javascript" id="Button4" style="WIDTH: 184px; HEIGHT: 24px" onclick="return Button4_onclick()"
    type="button" value="Using DocumentObj's Property " name="Button4"><INPUT language="javascript" id="Button2" style="WIDTH: 88px; HEIGHT: 24px" onclick="return ShowCtrl_onclick()"
    type="button" value="Show SubCtrl" name="ShowCtrl"><INPUT language="javascript" id="Button5" style="WIDTH: 88px; HEIGHT: 24px" onclick="return HideCtrl_onclick()"
    type="button" value="Hide SubCtrl" name="HideCtrl"></FONT><FONT face="宋体"><INPUT language="javascript" id="Button6" style="WIDTH: 88px; HEIGHT: 24px" onclick="return Button6_onclick()"
    type="button" value="PlayFlash" name="Button6">&nbsp;</FONT><FONT face="宋体, MS Song">
    </FONT><FONT color="#ff0066"><STRONG><FONT face="宋体">输入文字信息,观察.NET控件变化:</STRONG></FONT><INPUT language="javascript" id="Text1" style="WIDTH: 304px; HEIGHT: 22px" type="text"
    onchange="return Text1_onchange()" size="45" name="Text1"> <INPUT id="Button3" style="WIDTH: 48px; HEIGHT: 24px" type="button" value="OK" name="Button3">
    </FONT>
    </P>
    <P><STRONG><FONT color="#ff0066"></FONT></STRONG>&nbsp;</P>
    <P><STRONG><FONT color="#ff0066"></FONT></STRONG>&nbsp;</P>
    <P><STRONG><FONT color="#ff0066"></FONT></STRONG>&nbsp;</P>
    <P>&nbsp;</P>
    </TD></TR></TBODY></TABLE>
    <script language="VBScript">
    Sub Shockwaveflash1_FSCommand(ByVal command, ByVal args)
    DocObj.FSCommand command, args
    end sub
    </script>
    </FONT></P>
    </body>
    </html>