Flex: Constant strings in metadata
Posted
by Daniel Engmann
on Stack Overflow
See other posts from Stack Overflow
or by Daniel Engmann
Published on 2010-06-16T09:08:45Z
Indexed on
2010/06/16
9:12 UTC
Read the original article
Hit count: 248
flex
I have something like
public class Controller {
[Observer("fetchEmployeesEvent")]
public function fetchEmployees() : void {
//doSomething
}
}
and I want something like
public class Controller {
public static const FETCH_EMPLOYEES_EVENT : String = "fetchEmployeesEvent";
[Observer(FETCH_EMPLOYEES_EVENT)]
public function fetchEmployees() : void {
//doSomething
}
}
My problem is that only the first code snippet works. Flex seems to ignore the constant FETCH_EMPLOYEES_EVENT
in the metadata-tag.
My question is: Is it somehow possible to use constant strings in metadata?
© Stack Overflow or respective owner