Created
July 15, 2012 10:23
-
-
Save darkredz/3116189 to your computer and use it in GitHub Desktop.
JS AS3 communication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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