|
Quick links:
F-IN-BOX DLL Edition Home Page
| Buy license
| Welcome to our forum!
| Ask your question
| Help on the Web
F-IN-BOX DLL Edition Help >> Native Flash ActiveX Interface External API
F-IN-BOX supports External API. You can call functions of a movie and a movie is able to get data from an application synchronously (instead of fscommand).
Call an ActionScript function from an application Register your function using ExternalInterface.addCallback: [ ActionScript ]
import flash.external.*;
ExternalInterface.addCallback("CallMeFromApplication", this, InternalFunction);
function InternalFunction(str: String): String {
TextArea1.text = str;
return "The function was called successfully";
}
Use function FPCCallFunction or FPCCallFunctionBSTR: [ C++ ]
TCHAR szResponse[1024] = { 0 };
DWORD dwLength = sizeof(szResponse) / sizeof(szResponse[0]) - 1;
FPCCallFunction(m_hwndFlashPlayerControl,
_T("<invoke name=\"CallMeFromApplication\" returntype=\"xml\"><arguments><string>Some text for FlashPlayerControl</string></arguments></invoke>"),
szResponse,
&dwLength);
AfxMessageBox(CString(_T("The function returned: ")) + szResponse);
[ C++ ]
BSTR bstrRequest = SysAllocString(L" Call an application function from a flash script Use flash.external.ExternalInterface.call: [ ActionScript ]
on (click) {
_root.TextArea1.text = flash.external.ExternalInterface.call("SomeFunction");
}
Handle notification FPCN_FLASHCALL: [ C++ ]
|