【发布时间】:2011-03-23 19:00:39
【问题描述】:
可能有更好的方法来做到这一点...如果有,请提出建议。
我有一些调用 AIR 函数的 javascript。此 AIR 函数创建一个新的 HTML 元素并将其添加到“舞台”,如下所示:
// guid is the ID given to the new window (HTML element) by javascript
private function createNewWindow(guid:String):void {
var frame:HTML = new HTML();
frame.id = guid;
addElement(frame);
}
现在我还有一个函数可以根据框架的 id 设置框架的 location...这就是我苦苦挣扎的地方。
// set the location of the window referenced by it's id (guid)
private function setLocation(guid:String, location:String):void {
// psuedocode. Obviously it won't work.
stage.getById(guid).location = location;
}
那么,我如何根据其 ID“获取”我的 HTML 元素?
【问题讨论】:
标签: javascript flash apache-flex air