Skip to content

takimo/as3jsdelegate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

as3jsdelegate

= Description

This library enable to recive asynchronously ExternalInterface - "call".

inspire:  http://code.google.com/p/facebook-actionscript-api/source/browse/trunk/source/actionscript/com/facebook/delegates/JSDelegate.as

= Author

Shinya Takimoto, <shinya.takimoto@gmail.com>

= License

MIT-License

= Usage

// ActionScript
var private _delegate:JSDelegate;
var private _profileCall:JSCall;

public Main():void
{
    _delegate = new JSDelegate();
    _profileCall = new JSCall("getProfile", "xxxxxx");
    _profileCall.addEventListener(JSCallEvent.RECIVE, profile_reciveHandler);
    _delegate.execute(_profileCall);
}

private function profile_reciveHandler(e:JSCallEvent):void
{
    trace(e.result);
}

// Javascript
function getProfile(profileid, requestid){

    // something...

    var name = data.getName();
    var user = {nickname: name};
    swf("externalswf").replyCall(user, requestid);
}

About

This library enable to recive asynchronously ExternalInterface - "call".

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published