开发者

String and value object

In php we can assign a method name to a variable and then use that variable to call the method. For example:


$image_create_func = 'ImageCreateFromGIF';
$newImage = $image_create_func($oldImage);

But can we do this in Flex?

In flex, I have the string

public var key:String = "email"
And I also have a value object searchTerm:SearchTermVO which has a public property "email" (searchTerm.email).

Now I want to do searchTerm.email by开发者_如何学Go doing something like in php: searchTerm.key but it's not possible.

Can anybody help me with this plz?

Thank you.


You can use the square brackets:

var email:String = SearchTErm[email];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜