flash->javascript
javascript端:
< script language="javascript" >
function getLocation() {
return window.location.toString();
}
< /script >
Flash 端:
import flash.external.ExternalInterface;
function displayPageLocation():Void {
locationDisplay.text = ExternalInterface.call("getLocation");
}
locationButton.addEventListener("click", mx.utils.Delegate.create(this, displayPageLocation));
javascript->flash
javascript端:
< script language="javascript" >
function displayFlashInfo() {
//適用ie,netscapt需用window.document.flashObject
var flashInfo = window.flashObject.getFlashInfo();
for(var key in flashInfo) {
document.flashForm.flashInfoDisplay.value += key + ": " + flashInfo[key] + "\n";
}
}
< /script >
Flash端:
import flash.external.ExternalInterface;
function getFlashInfo():Object {
return System.capabilities;
}
ExternalInterface.addCallback("getFlashInfo", this, getFlashInfo);
这样是不是更爽了?
javascript端:
< script language="javascript" >
function getLocation() {
return window.location.toString();
}
< /script >
Flash 端:
import flash.external.ExternalInterface;
function displayPageLocation():Void {
locationDisplay.text = ExternalInterface.call("getLocation");
}
locationButton.addEventListener("click", mx.utils.Delegate.create(this, displayPageLocation));
javascript->flash
javascript端:
< script language="javascript" >
function displayFlashInfo() {
//適用ie,netscapt需用window.document.flashObject
var flashInfo = window.flashObject.getFlashInfo();
for(var key in flashInfo) {
document.flashForm.flashInfoDisplay.value += key + ": " + flashInfo[key] + "\n";
}
}
< /script >
Flash端:
import flash.external.ExternalInterface;
function getFlashInfo():Object {
return System.capabilities;
}
ExternalInterface.addCallback("getFlashInfo", this, getFlashInfo);
这样是不是更爽了?
回复Comments
{commenttime}{commentauthor}
{CommentUrl}
{commentcontent}