Programmatically Detecting Valid Style Properties In Flex

Posted by Joshua on Stack Overflow See other posts from Stack Overflow or by Joshua
Published on 2010-06-08T22:17:15Z Indexed on 2010/06/08 22:22 UTC
Read the original article Hit count: 264

If I want to know if an object has a particular property I can code this:

if (SomeObject.hasOwnProperty('xyz')) {
  // some code
}

But some styles masquerade as properties at design time such as Button.color... How can I know what style properties are valid at runtime? ie: What is the equivalent of hasOwnProperty for getStyle/setStyle?

In other words how can I know if an object HAS A particular style variable... When I write:

MyButton.setStyle('qsfgaeWT','-33');

It won't accomplish anything, but it also doesn't error. How can I know programmatically that 'qsfgaeWT' is NOT a valid style of 'Button'??

© Stack Overflow or respective owner

Related posts about flex

Related posts about flash