C#和Flash通信 [英] C# and Flash communication

查看:276
本文介绍了C#和Flash通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法对C#来获得的SWF公开通过ExternaInterface的方法列表?

Is there any way for C# to get a list of the methods the swf exposes through ExternaInterface?

推荐答案

更新:

只是意识到,我误解你的问题,你在寻找通过的Flex的 ExternalInterface类 ,而不是那些冲击波ActiveX控件本身;我要留着下面,因为它可能仍然是有帮助的就通过C#一般 SWF 使用我原来的答复。

Just realized that I've misread your question as you are looking for methods defined via the Flex ExternalInterface class rather than those of the Shockwave ActiveX control itself; I'm gonna keep my original answer below as it might still be helpful regarding SWF usage via C# in general.

关于 ExternalInterface的我没有答案,现在,但你可能会考虑的趣味与C#和Flash Player 8外部API ,以获取有关如何在第一时间通过C#使用此API的想法。 (另一个有用的样本可能是的Flash 8中的Python和C#应用的使用外部接口。)

Concerning ExternalInterface I don't have an answer right now, but you might look into Fun with C# and the Flash Player 8 External API to get an idea on how to use this API via C# in the first place. (Another helpful sample might be Use External Interface of Flash 8 in Python and C# Applications.)

这是我所读的前篇有可能没有直接的解决方案,并通过传球的调用约定制作的<一个href="http://livedocs.adobe.com/flex/3/html/help.html?content=19%5FExternal%5FInterface%5F08.html#134555"相对=nofollow> XML片段来的 CallFunction() 都有点古怪,但你仍应该能够把乔治·<一个href="http://stackoverflow.com/questions/1353525/c-and-flash-communication/1353952#1353952">solution这个原则(正如我所说,很可能不会是pretty的;)

From what I'm reading in the former article there is likely no straight forward solution and the calling conventions via passing crafted XML fragments to CallFunction() are somewhat quirky, still you should be able to translate Georges solution to this in principle (as I said, it's likely not gonna be pretty ;)

祝你好运!


如何通过COM互操作访问的SWF从.NET:

SWF 适用于Windows的实现由的Adobe Flash Player 的 ActiveX控件,因此你会通过的 COM互操作性。

SWF for Windows is implemented by means of the Adobe Flash Player ActiveX control, consequently you would use it from .NET via COM Interoperability.

您可以找到一个(传统)文章/样品在Adobe的网站关于这一点,看到的在C#应用程序来显示股票信息一个概述(请注意按语有关的样品code不可用的文章),见下文。嵌入的Macromedia Flash Player

You can find a (legacy) article/sample regarding this on Adobes site, see Embedding Macromedia Flash Player in a C# Application to Display Stock Information for an overview (please note the introductory note of the article regarding unavailability of the sample code), but see below.

更具体,你可以找到你需要采取实现这篇文章的另一页上的目标的初始步骤,看到的嵌入,并与C#Windows应用程序的Macromedia Flash Player的沟通 - 特别请按照文章/步骤,甚至包括部分的使Macromedia Flash Player的ActiveX控件可用在Visual Studio .NET中的。

More specifically you can find the initial steps you need to take to achieve your goal on another page of this article, see Embedding and Communicating with the Macromedia Flash Player in C# Windows Applications - in particular please follow the article/steps up to and including section Making the Macromedia Flash Player ActiveX Control Available Within Visual Studio .NET.

一旦您完成了概述步骤将冲击波的ActiveX控件添加到您的工具箱和一个特定的项目引用您只需双击该引用(名为 ShockwaveFlashObjects 在Visual Studio 2008),这将打开的 Visual Studio的对象浏览器的突出组装Interop.ShockwaveFlashObjects ;然后向下导航到命名空间ShockwaveFlashObjects ,在那里你会发现,除其他外,在接口IShockwaveFlash ,露出(视您的视图过滤器),它的所有成员,包括所需的外部方法各自的C#签名

Once you have completed the outlined steps to add the Shockwave ActiveX control to your toolbox and to a particular projects references you can simply double click this reference (named ShockwaveFlashObjects in Visual Studio 2008), which will open the Visual Studio object browser highlighting the assembly Interop.ShockwaveFlashObjects; then navigate down into the namespace ShockwaveFlashObjects, where you'll find, amongst others, the interface IShockwaveFlash, exposing (depending on your view filter) all its members, including the desired external methods with their respective C# signatures.

这篇关于C#和Flash通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆