#include "FlashDelegate.h"Functions | |
| Flash4UIExport void * | CreateFlashControl (const std::wstring &url, int x, int y, int width, int height, bool taskButton=false) |
| Flash4UIExport void | DestroyFlashControl (void *pFlashControl) |
| Flash4UIExport void | MoveFlashControl (void *pFlashControl, int x, int y, int width, int height) |
| Flash4UIExport HWND | GetWindowHandle (void *pFlashControl) |
| Flash4UIExport void | Show (void *pFlashControl) |
| Flash4UIExport void | Hide (void *pFlashControl) |
| Flash4UIExport void | Load (void *pFlashControl, const std::wstring &movieFilename) |
| Flash4UIExport void | SetTopMost (void *pFlashControl, bool topmost) |
| Flash4UIExport void | SetDraggable (void *pFlashControl, bool enable, bool useRightButton=false) |
| Flash4UIExport void | SetTrackable (void *pFlashControl, bool enable) |
| Flash4UIExport void | SetOpacity (void *pFlashControl, float opacity) |
| Flash4UIExport void | Bind (void *pFlashControl, const std::wstring &funcName, const FlashDelegate &callback) |
| Flash4UIExport void | Unbind (void *pFlashControl, const std::wstring &funcName) |
| Flash4UIExport FlashValue | CallFunction (void *pFlashControl, std::wstring funcName, const Arguments &args=Args()) |
| Flash4UIExport void Bind | ( | void * | pFlashControl, | |
| const std::wstring & | funcName, | |||
| const FlashDelegate & | callback | |||
| ) |
Binds a local callback to a certain function name so that your Flash movie can call the function from ActionScript using ExternalInterface.call('functionName').
| pFlashControl | The pointer of the flash control created with createFlashControl. | |
| funcName | The name to bind this callback to. The name "WindowMessageHooker" is reserved for hook message of the flash control. | |
| callback | The local function to call, see below for examples of declaring a FlashDelegate. |
// Example declaration of a compatible function (static function): FlashValue myStaticFunction(void* caller, const Arguments& args) { // Handle the callback here return FLASH_VOID; } // Example declaration of a compatible function (member function): FlashValue MyClass::myMemberFunction(void* caller, const Arguments& args) { // Handle the callback here return "Some return value!"; } // Set the function callback (class member function) Bind(pFlashControl, "functionName", FlashDelegate(this, &MyClass::myMemberFunction); Bind(pFlashControl, "functionName", FlashDelegate(pointerToClassInstance, &MyClass::myMemberFunction); // Set the function callback (static function) Bind(pFlashControl, "functionName", FlashDelegate(&myStaticFunction); // Example for using WindowMessageHooker FlashValue MyClass::MyMessageProc(void* caller, const Arguments& args) { UINT Msg = (UINT)args.at(0).getNumber(); WPARAM wParam = (WPARAM)args.at(1).getNumber(); LPARAM lParam = (LPARAM)args.at(2).getNumber(); // Do something to enjoy the message //.... // we have handled the message, stop transferring to the flash control. return true; // return false to let the flash control handle this message } // Set the message hooker Bind(pFlashControl, "WindowMessageHooker", FlashDelegate(this, &MyClass::MyMessageProc));
| Flash4UIExport FlashValue CallFunction | ( | void * | pFlashControl, | |
| std::wstring | funcName, | |||
| const Arguments & | args = Args() | |||
| ) |
Attempts to call a function declared as a callback in the ActionScript of the currently-loaded movie.
| pFlashControl | The pointer of the flash control created with createFlashControl. | |
| funcName | The name of the callback that was declared using 'ExternalInterface.addCallback(funcName, function)' in the ActionScript of the currently-loaded movie. | |
| args | The arguments to pass to the ActionScript function. |
| Flash4UIExport void* CreateFlashControl | ( | const std::wstring & | url, | |
| int | x, | |||
| int | y, | |||
| int | width, | |||
| int | height, | |||
| bool | taskButton = false | |||
| ) |
create a new flash control including the window it created. Confirm to call CoInitialize(NULL) first before you create any Flash control.
| url | The url of the swf file, whether local file or a network file. | |
| x | The left coordinate of the new flash window. If created as a child, the x is relative to it's parent. otherwise it is relative to the screen. | |
| y | The top coordinate of the new flash window. If created as a child, the y is relative to it's parent. otherwise it is relative to the screen. | |
| width | The width of the new flash window. | |
| height | The height of the new flash window. | |
| taskButton | Indicates whether the flash window created as PopupWindow or ToolWindow. The difference is that there's no button on the task bar when created as ToolWindow. |
| Flash4UIExport void DestroyFlashControl | ( | void * | pFlashControl | ) |
Destroys flash control including the window it created.
| pFlashControl | The pointer of the flash control created with createFlashControl. |
| Flash4UIExport HWND GetWindowHandle | ( | void * | pFlashControl | ) |
Gets the window handler of the flash control.
| pFlashControl | The pointer of the flash control created with createFlashControl. |
| Flash4UIExport void Hide | ( | void * | pFlashControl | ) |
Hides the flash window.
| pFlashControl | The pointer of the flash control created with createFlashControl. |
| Flash4UIExport void Load | ( | void * | pFlashControl, | |
| const std::wstring & | movieFilename | |||
| ) |
Loads a movie (a .swf file) into this Flash Control and begins playing.
| pFlashControl | The pointer of the flash control created with createFlashControl. | |
| movieFilename | The filename of the movie to load. |
| Flash4UIExport void MoveFlashControl | ( | void * | pFlashControl, | |
| int | x, | |||
| int | y, | |||
| int | width, | |||
| int | height | |||
| ) |
Moves the flash control to a specified position of the screen or change the size of the window.
| pFlashControl | The pointer of the flash control created with createFlashControl. | |
| x | The left coordinate. | |
| y | The top coordinate. | |
| width | The new width of the flash control. | |
| height | The new height of the flash control. |
| Flash4UIExport void SetDraggable | ( | void * | pFlashControl, | |
| bool | enable, | |||
| bool | useRightButton = false | |||
| ) |
Sets whether this Flash Control is draggable via the right-mouse-button, this is only applicable to FlashControls created as an overlay.
| pFlashControl | The pointer of the flash control created with createFlashControl. | |
| enable | Whether or not this Flash Control should be draggable. | |
| useRightButton | Whether or not use the right button of mouse to drag the window. |
| Flash4UIExport void SetOpacity | ( | void * | pFlashControl, | |
| float | opacity | |||
| ) |
Sets the opacity of this Flash Control.
| pFlashControl | The pointer of the flash control created with createFlashControl. | |
| opacity | The opacity as a Real value; 0 is totally transparent, 1 is totally opaque. |
| Flash4UIExport void SetTopMost | ( | void * | pFlashControl, | |
| bool | topmost | |||
| ) |
Sets the flash window topmost.
| pFlashControl | The pointer of the flash control created with createFlashControl. | |
| topmost | Whether topmost. |
| Flash4UIExport void SetTrackable | ( | void * | pFlashControl, | |
| bool | enable | |||
| ) |
Sets whether this Flash Control is hidden after one command, also hidden when the flash control is deactivated. This is typically used for menu.
| pFlashControl | The pointer of the flash control created with createFlashControl. | |
| enable | Whether or not this Flash Control should be trackable. |
| Flash4UIExport void Show | ( | void * | pFlashControl | ) |
Shows the flash window.
| pFlashControl | The pointer of the flash control created with createFlashControl. |
| Flash4UIExport void Unbind | ( | void * | pFlashControl, | |
| const std::wstring & | funcName | |||
| ) |
Un-binds the specified callback.
| pFlashControl | The pointer of the flash control created with createFlashControl. | |
| funcName | The name that the callback was bound to. |
1.5.2