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 stringpublic 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];
精彩评论