Ultrashock Forums > Flash > Components
Component Default Style Problem

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#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 | 765 views postbit arrow Reply: with Quote   
Registered User
Polaco is offline
seperator
Posts: 945
2002-09-09
Age: 28
Polaco lives in Argentina
Polaco's Avatar
seperator

Ultrashock Member Comments:
gusmcq's Avatar gusmcq gusmcq is offline gusmcq lives in United Kingdom Creative Assets 2008-03-28 #2 Old  
It seems there's a bug in the CS3 Component Framework. I'd guess that's causing your problem. You can find out more about it (and the fix) at http://www.gskinner.com/blog/archive...mponent_b.html
Reply With Quote  
Polaco's Avatar Polaco Polaco is offline Polaco lives in Argentina 2008-03-29 #3 Old  
Great gusmcq!!!

That was the solution. I never imagine that this was a bug in the CS3 Component Framework. I spent like 7 hours trying to figure out what was I doing wrong .

thanks a lot,


Polaco.
Reply With Quote  
Thread Tools
Display Modes Rate This Thread
Rate This Thread: