0

AS3 では、キーに具体的に名前を付けるのではなく、共有オブジェクトのキーを文字列の内容で設定したいと考えています。

so.data.test = "andy"   // this is the basic working system 

私はテストを書きたくない私はこのようなものが欲しい

// this is a non working and incorrect solution but shows what I am trying to do.
String myKey = "test"
so.data.{myKey} = "andy" 

これは不可能な質問ですか?

4

1 に答える 1

4

テストされていませんが、試すことができます:

var myKey:String = "test";
so.data[myKey] = "andy";
于 2011-07-18T08:28:47.833 に答える