問題描述
是否可以使用任何 IPC 機制從 Adob??e Flash 動作腳本調用 c++ api?有什么好的例子嗎?
Is it possible to use any IPC mechanism for calling a c++ api from Adobe Flash actionscript? Are there any good examples?
更新:我現在主要希望它用于桌面應用程序,即 Adob??e 的/或任何其他人的桌面運行時
Update: I primarily want it for desktop apps now i.e Adobe's/or anyuone else's desktop runtimes
推薦答案
不是來自 Flash Player,因為它很可能會違反其安全模型.您可以從 Tamarin VM 調用 C++,例如 mod-actionscript 正在執行.一種選擇是將您的調用傳遞到 AS3 服務器,在那里調用一些 C++ 函數并將結果發回.另一種選擇是使用 alchemy 將 C++ 代碼交叉編譯到 AVM2.但是,如果您想調用 C++ 來訪問客戶端計算機上 Flash Player 無法提供的功能(文件系統訪問、UDP 或其他),那就沒有辦法了.
Not from the flash player, as it would very likely violate its security model. You can call C++ from the Tamarin VM, which for example mod-actionscript is doing. An option would be to pass your calls to an AS3-server, call some C++ functions there and send back the result. Another option is to cross-compile the C++ code to AVM2 using alchemy. But if you want to call C++ to access features on the client machine not available from the flash player (file system access, UDP or whatever), then there's no way.
好的,我想有以下選項:
edit:
Ok, I suppose there are the following options:
- 查看
flash.accessibility
打包并僅使用 AS3 解決 - 創建一個后臺運行的C++守護進程,可以和flash through進行雙向通信
- 具有自定義協議的本地套接字(您將在守護進程中綁定一個端口,Flash 客戶端將連接到它)
- 一個
LocalConnection
.從 AS3 的角度來看,這看起來好一點,但需要在 C++ 方面進行一些黑客攻擊,因為您需要掌握連接并實現協議(指針 這里)
- have a look at the
flash.accessibility
package and solve it with AS3 only - create a C++ daemon running in the background, which can have bidirectional communication with flash through
- a local socket (you'd bind a port in the daemon and the flash client would connect to it) with a custom protocol
- a
LocalConnection
. This looks a little better from the AS3 perspective, but requires a little hacking on the C++ side, since you need to get hold of the connection and implement the protocol (pointers here)
這篇關于c++ 和 actionscript 3 之間的通信的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!