【发布时间】:2010-08-08 21:01:07
【问题描述】:
这是我的意思的一个简单示例:
private var ex:String="day";
......
closeWindows(ex);
trace(ex);//I would like it to trace "night"
......
//this can be in another class, we assume that the "ex" variable can't be accessed directly
private function closeWindows(context:String):void {
context = "night"
}
不知何故,我需要将引用而不是值本身传递给“closeWindows”方法。
非常感谢任何帮助。 谢谢。
【问题讨论】:
-
到目前为止,我只找到了一个肮脏的解决方案,将字符串包装在一个对象或数组中。因为 Array 和 Object 数据类型包含对值的引用而不是包含其实际值,所以我会得到我需要的。但我有点想要一个更清晰的解决方案。 :)
标签: apache-flex flash actionscript-3