2006/02/28 | Flash 8 & Javascript
类别(Flash&AS2) | 评论(1) | 阅读(62) | 发表于 12:50
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);

这样是不是更爽了?
0

评论Comments

日志分类
首页[116]
Flash&AS2[56]
FMS[3]
Flex&AS3[5]
Asp[5]
My Works[13]
My Life[34]