Skip to content

Instantly share code, notes, and snippets.

@darkredz
Created July 15, 2012 10:23
Show Gist options
  • Save darkredz/3116189 to your computer and use it in GitHub Desktop.
Save darkredz/3116189 to your computer and use it in GitHub Desktop.
JS AS3 communication
function triggerAS3(funcName, param){
if(param){
if(typeof param == "string")
window.location = 'as3:'+ funcName +':' + param;
else
window.location = 'as3:'+ funcName +':' + JSON.stringify(param);
}else{
window.location = 'as3:'+ funcName;
}
}
//Now trigger some AS3, make them communicate!
triggerAS3('myAS3Func', {username:'leng', password:'1234'});
triggerAS3('anotherFuncWithNoParam');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment