View Single Post

#1
Bookmark and Share!
Component Default Style Problem
Old 2008-03-28

Hi,

I have the following declaration inside my custom component:

ActionScript Code:
  1. private static var defaultStyles:Object = {
  2.             highLightImage:null,
  3.             bulletImage:null,
  4.             styleSheet: null,
  5.             embedFonts:false
  6.         }
  7.        
  8.        
  9.         public static function getDefaultStyles():Object {
  10.             return defaultStyles;
  11.                         /*with this doen't work either UIComponent.mergeStyles(defaultStyles, UIComponent.getStyleDefinition());*/
  12.         }

when I set the style for the component from the fla root, before creating an instance of it:
ActionScript Code:
  1. StyleManager.setComponentStyle(ContentDisplay, "styleSheet", sheet);

then the component fails to get the style from draw() method when it calls
ActionScript Code:
  1. getStyleValue("styleSheet");

The component constructor is executing it's parent correctly as specification says.

if I set the style after the component is instanced then it can retieve the style correctly..

what can I do? What I am missing? Please help..

thanks.
a great community.
postbit arrow 2 comments | 764 views postbit arrow Reply: with Quote   
Polaco
Registered User
Polaco is offline
seperator
Posts: 945
2002-09-09
Age: 28
Polaco's Avatar
seperator

Ultrashock Member Comments: