|
|||
|
Due to the nature of my current project, I can't use Swfkit calls directly in the ActionScript code. Therefore I am planning to communicate to the Swfkit container using the ExternalInterface to call scripts I write in Swfkit. ExternalInterface.call works as expected. However at certain points, the communication requires that I trigger an ActionScript function from Swfkit.
If I use ExternalInterface to add a callback method like so: ExternalInterface.addCallback( "handlerName", this, handlerFunction ); How do I call the function from a SwfKit script? Please let me know. I tried FlashPlayer.handlerName() but that did not work. |
|
|||
|
You can call a ffish script in actionscript in the way shown in the following code:
Code:
ExternalInterface.call("ffish_run", "myscriptname");
|
|
|||
|
Sorry for the confusion, I am actually looking for how to initate an ActionScript function from an ffish script. So if I add a callback in actionscript like so:
Code:
ActionScript:
handlerFunction = function(){
//some work
}
ExternalInterface.addCallback( "handlerName", this, handlerFunction );
|
|
|||
|
Please call the "Application.registerASMethods" in ffish script, which can register more than one as methods at one time. After registering the as methods, you can call them in ffish script as if they are ffish script methods. For example:
Code:
Application.registerASMethods("handlername0", "handlername1", "handlername2");
handlername0(arg0, arg1, arg2);
handlername2(arg0, arg1);
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|