So there are two parts to this. I'm reiterating your replies:
1. Get a reference to a component at runtime via code and providing a list
of all applicable styles just like design time displays in the property
inspector.
A: this is not possible to get all the styles of a component unless the
metadata styles are compiled into the swf. plus there may be additional
styles defined by themes and skins (skins can define styles???) that there
is no way to get access to.
me: Is there then a file that FB uses that contains all the styles in
existence?
2. Getting all the styles that have been applied to a component to create a
style / inheritance tree like in Firebug. See attached image...
A: you can use getStyle to get the computed style but only if you know the
name of the style. ie getStyle("style")
me: is there a getStyle() method that returns all computed styles?
me: is there an api (online even) that exists that i can pass a qualified
class name to get this information? for example,
myService.url = "http://alexh.adobe.com/sdkapi.php"
myService.send({className:UIComponent, styles:true, properties:true})
// returns an xml list of all properties and styles for the given class?
<UIComponent>
<styles>
<style name="border" defaultValue="1px" />
<style name="color" defaultValue="1px" />
<style name="padding" defaultValue="1px" />
...
</styles>
<properties>
<property name="text" defaultValue="" type="String"/>
<property name="etc" />
...
</properties>
</UIComponent>
On Sat, Jun 26, 2010 at 12:23 AM, Alex Harui <[email protected]> wrote:
>
>
> Styles are defined by metadata and further controlled by the theme and
> skin. You’d probably have to retain metadata to introspect at runtime.
>
> I’m not sure I understand the last question. getStyle() would return the
> computed style.
>
>
>
> On 6/25/10 5:38 PM, "[email protected]" <
> [email protected]> wrote:
>
>
>
>
>
>
> How do you get a list of all styles that a component supports?
>
> var buttonStyles:Array = getStyles(buttonComponent);
> var containerStyles:Array = getStyles(borderContainer);
>
> The follow up question to this is there a recommended api to get the
> computed style for that component instance?
>
> JP
>
>
>
>
>
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>
>