AS3 swf call javascript

var r:URLRequest = new URLRequest("javascript:functionName()");
navigateToURL(r,'_self')

 

Call AS3 function from JS using ExternalInterface class

To call an Actionscript 3 function from Javascript:

import flash.external.ExternalInterface;

ExternalInterface.addCallback("changeText", changeTheText); // so javascript from html can talk to flash

function changeTheText(t:String):void {
	txtText.text = t;
}

 

延伸

http://www.hardcode.nl/archives_155/article_334-call-javascript-function-from-as3-and-viceversa


 © 2024 - KennyWriter 

Clef two-factor authentication