Hey...
The probelms you're having are the exact reason why I don't use components. In efforts to skin them to look presentable, it causes way more trouble than it's worth.
For me, it would be easier to create it from scratch.
As I've never throughly spent the time to work with these compenents, the solution I'm offering might not be the definite answer.
After looking at your code, the culprits seem to be the icons that you're using:
The following style declartations, to be specific:
Code:
this.tree.setStyle("defaultLeafIcon", "nullicon");
this.tree.setStyle("disclosureClosedIcon", "nullicon");
this.tree.setStyle("folderOpenIcon","treeFolderOpen");
this.tree.setStyle("folderClosedIcon","treeFolderClosed");
I recreated a functional menu (with MOST of your styles) by doing the following:
1) Open up a new flash document
2) Drag out a tree component onto the stage and resize, etc...
3)Add the following actionscript:
Code:
var treeL:Object = new Object();
treeL.change = function() {
var item = tree.selectedItem;
var earl = item.attributes.url;
if(earl) {
getURL(earl,"_self");
}
}
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function() {
tree.dataProvider = this.firstChild;
}
xml.load("menu.xml");
tree.addEventListener("change", treeL);
// customize tree styles
this.tree.setStyle("fontFamily", "Arial");
this.tree.setStyle("fontSize",11);
this.tree.setStyle("embedFonts", this.test_text.embedFonts)
this.tree.setStyle("fontWeight", "normal");
this.tree.setStyle("depthColors",[0xCBE1EB, 0xC4E6B3, 0xF2F2CA, 0x01498F, 0x01509C, 0x0153A3]);
this.tree.setStyle("backgroundColor",0xFFFFFF)
this.tree.setStyle("borderStyle", "none");
this.tree.setStyle("color",0x000000);
this.tree.setStyle("textIndent",0);
this.tree.setStyle("indentation",20);
this.tree.setStyle("rollOverColor",0xFDA333);
this.tree.setStyle("selectionColor",0x80B7D5);
this.tree.setStyle("selectionDuration",150);
this.tree.setStyle("textRollOverColor",0xFFFFFF);
this.tree.setStyle("textSelectedColor",0xFFFFFF);
this.tree.setStyle("disclosureOpenIcon", "nullicon");
this.tree.vScrollPolicy = 'off';
4) Add links to XML. XML below (your formatting was wrong):
Code:
<tree>
<folder label="HIV">
<link label="Combivir" url="http://www.astarte.com" />
<link label="Epivir" url="" url="" />
<link label="Epivir-HBV" url="" />
<link label="Epzicom" url="" />
<link label="Lexiva" url="" />
<link label="Retrovir" url="" />
<link label="Trizivir" url="" />
<link label="Ziagen" url="" />
</folder>
<folder label="Respiratory">
<link label="Advair products" url="" />
<link label="Allermist" url="" />
<link label="Flonase" url="" />
<link label="Flovent Products" url="" />
<link label="Serevent Products" url="" />
<link label="Ventolin" url="" />
</folder>
<folder label="Neurosciences">
<link label="Amerge" url="" />
<link label="Imitrex" url="" />
<link label="Parnate" url="" />
</folder>
</tree>
5) Test the Flash.
It will be fully functional, except for the icons. I think you added the class extention specifically for that functionality. I can appreciate your style priorities there (I would want to get rid of those icons too). But when you get rid of the icons, the menu isn't functional.
I'm going to keep messing with it, I'll post back if I can get some of your icons to work.
Bookmarks