all groups > flash actionscript > july 2004 >
You're in the

flash actionscript

group:

tree component style


tree component style cabp ms
7/8/2004 8:12:56 PM
flash actionscript: Hi all, I have a movie clip, there are a clip with a little animation, inside
this clip is another one
that contains a tree component, i call it "treeClip", the action script in the
first frame of "treeClip"
populates the tree nodes readin data from an xml file.

At the second frame of _root i set the global style for components, like this:

_global.style.setStyle('selectionColor', '0x9DBBC4');
_global.style.setStyle('rollOverColor', '0xDAE6E9');

i set it in the second frame of _root because in the first fram i read
variable from external files
All this works perfect, but stly for font weight and font size doesn't work
when tree component
is NOT in _root, when i place the tree component in _root it works fine, i did
it like this

_global.style.setStyle('fontWeight', 'bold');
_global.style.setStyle('fontSize', '12');


but not working, i tried this too:

_global.style.setStyle("fontWeight", "bold");
_global.style.setStyle("fontSize", "12");

but still not working, i tried this too:

var styleObj=new mx.styles.CSSStyleDeclaration;
styleObj.styleName="treeStyle";
_global.styles.newStyle=styleObj;
treeStyle.fontSize=14;
treeStyle.fontWeight="bold";
styleObj.color = 0x336699;
styleObj.setStyle("themeColor", "haloOrange");
myTree.setStyle("treeStyle", "newStyle");

but this code doesn't work at all at any frame in any movie clip

I tried adding the code in many movie clips but font wheight and size only
works in _root
can any body PLEASE tell me why this happens??? do You have a problem like
this??? do you have
a solution???

Any help will be apreciated

THANKS
Re: tree component style cabp ms
9/8/2004 6:06:03 PM
AddThis Social Bookmark Button