Synchronous Communication in ActionScript
The SWHX library provides extensions for both ActionScript 2 and ActionScript 3, so you don ??™ t have to
use haXe to compile your SWF ??™ s in order to make use of SWHX. Using the extensions is simple,
requiring a call to initialize the extension, followed by the necessary calls to the Neko layer when you
want to execute Neko - based functions.
To demonstrate, here is an ActionScript 2 version of the previous example:
import swhx.Api;
class UI extends MovieClip
{
static var className : String = ???UI???;
static var register : Object = registerClass( className, UI );
static var receive_tf : TextField;
static var send_tf : TextField;
static var send_mc : MovieClip;
static function main()
{
_root.attachMovie( UI.className, ???ui???, 0 );
}
(continued)
Part III: Extending the Possibilities
524
public function UI()
{
Api.init( this );
send_tf = this.createTextField( ???send_tf???, 1, 10, 10, 150, 20 );
send_tf.border = true;
send_tf.type = ???input???;
receive_tf = this.
Pages:
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973