Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-21-2006, 02:11 PM
Junior Member
 
Join Date: Sep 2006
Posts: 2
Default addCallback Syntax

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.
Reply With Quote
  #2 (permalink)  
Old 09-22-2006, 06:31 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:addCallback Syntax

You can call a ffish script in actionscript in the way shown in the following code:

Code:
ExternalInterface.call("ffish_run", "myscriptname");
where "myscriptname" is the name of the ffish script to call, that is, you must change it to the name of your ffish script.
Reply With Quote
  #3 (permalink)  
Old 09-27-2006, 08:55 PM
Junior Member
 
Join Date: Sep 2006
Posts: 2
Default Re:addCallback Syntax

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 );
What would the ffish script look like to intiate the handler function?
Reply With Quote
  #4 (permalink)  
Old 09-28-2006, 12:15 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:addCallback Syntax

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);
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:54 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.