How do I get the namespace prefix?
Posted
by
1.21 gigawatts
on Stack Overflow
See other posts from Stack Overflow
or by 1.21 gigawatts
Published on 2012-09-17T21:21:07Z
Indexed on
2012/09/18
3:38 UTC
Read the original article
Hit count: 102
Is there a way to get the namespace prefix from a class or class instance (an object not XML)? For example, in MXML you could declare something as s:Button or local:MyComponent. Is there some call or approach that will return the "s" or "local" value when given the object?
For example, if I have the class TextInput and I wanted to show the style inheritance at runtime I could do something like this:
s|TextInput {
fontFamily:Arial;
}
s|TextArea#myTextArea {
color:red;
}
local|MyComponent.myBoldStyle {
fontWeight: bold;
}
© Stack Overflow or respective owner