Groups | Blog | Home
all groups > flash actionscript > june 2004 >

flash actionscript : how to change textAlign in MenuBar?


higgo
6/7/2004 8:56:19 PM
Hi,
I'm using the code below to try to make the MenuBar component menu items align
left (rather than the default center) but it doesn't seem to work. Any ideas
what I'm doing wrong?

I also need to specify an absolute width for the menu items...

thanks,
Mike

var styleObj = new mx.styles.CSSStyleDeclaration;
styleObj.styleName = "newStyle";
_global.styles.newStyle = styleObj;

styleObj.fontFamily = "Futura Bk";
styleObj.fontSize = 11;
styleObj.color = 0x336699;
styleObj.setStyle("themeColor", "0xF1AA00");
styleObj.setStyle("backgroundColor", "0xFBEABF");
styleObj.setStyle("textAlign", "left");

myMenu.setStyle("styleName", "newStyle");


var menu = myMenu.addMenu("File");
menu.addMenuItem({label:"New", instanceName:"newInstance"});
menu.addMenuItem({label:"Open", instanceName:"openInstance"});
menu.addMenuItem({label:"Close", instanceName:"closeInstance"});
higgo
6/8/2004 4:14:23 PM
So I think the MenuBar uses Button and Menu subcomponents, but the instances
are created dynamically with names like "mbItem200".

The question remains - how do I reference and set styles on the MenuBar
component? I'd like to be able to turn off the shadow, set width, etc....

Anyone?
AddThis Social Bookmark Button