开发者

String and value object

开发者 https://www.devze.com 2022-12-23 20:01 出处:网络
In php we can assign a method name to a variable and then use that variable to call the method. For example:

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

精彩评论

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