You said in the prior email that when you drag the icons do not appear,
now you say the icons are fine.  I'm not really willing to help you
define which problems you are trying to solve.  The points to keep in
mind are:

 

1)       invalidation will cause the expand tween to not play

2)       icons are looked up in the document.

 

Good luck,

-Alex

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Rafael Faria
Sent: Wednesday, February 06, 2008 9:20 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Still Tree

 

The thing is... the icons are just fine, even when i open the branch
for the first time, the icons are all there. The only think it doesnt
work really well is when i load the application and i try to open it
for the first time, than it just popup my leafs instead of being
smooth with that animation of the leafs blinding down if you know what
i mean.

than when i close and open it again it just work fine. This happens on
all of the branches.

all i do is set a iconFunction in the begging of my constructor to
call the parseIcons function

public class menuTree extends Tree
{


public function menuTree()
{
super();
iconFunction = parseIcons;
}

private function parseIcons(node:XML, type:String = ""): void 
{
var nodeName:String = node.name();
if (type == "edit") {
if (nodeName == "module") {
if (getStyle("defaultEditModuleIcon") != null) { 
setItemIcon(node, getStyle("defaultEditModuleIcon"),
getStyle("defaultEditModuleIcon"));
}
} else if (nodeName == "category") { 
if (getStyle("folderEditIcon") != null) { 
setItemIcon(node, getStyle("folderEditIcon"),
getStyle("folderEditIcon"));
}
} else {
if (getStyle("defaultEditLeafIcon") != null) { 
setItemIcon(node, getStyle("defaultEditLeafIcon"),
getStyle("defaultEditLeafIcon"));
}
}
} else {
if (nodeName == "module") {
setItemIcon(node, getStyle("defaultModuleIcon"),
getStyle("defaultModuleIcon"));
} else if (nodeName == "category") { 
setItemIcon(node, getStyle("folderClosedIcon"),
getStyle("folderOpenIcon"));
} else {
setItemIcon(node, getStyle("defaultLeafIcon"),
getStyle("defaultLeafIcon"));
}
}
}

}

The icons are embed on a CSS file.

Tree {
disclosureClosedIcon: Embed('../assets/images/plus.png');
disclosureOpenIcon: Embed('../assets/images/minus.png');
folderClosedIcon: Embed('../assets/images/application.png');
folderOpenIcon: Embed('../assets/images/application_put.png');
folderEditIcon: Embed('../assets/images/application_edit.png');
defaultLeafIcon: Embed('../assets/images/file.png');
defaultEditLeafIcon: Embed('../assets/images/file_edit.png');
defaultModuleIcon: Embed('../assets/images/module.png');
defaultEditModuleIcon: Embed('../assets/images/module_edit.png');
disableColor:#CCCCCC;
defaultColor:#000000;
indentation:14;
}

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> If the icon is embedded in a different MXML file then it won't be
found
> in the destination tree
> 
> 
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of Rafael Faria
> Sent: Wednesday, February 06, 2008 3:27 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Re: Still Tree
> 
> 
> 
> another thing is happening is whenever i drag an element from another
> tree into my main tree the icon does not appear.
> 
> why would this happen?! 
> 
> --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%40yahoogroups.com>
> , "Alex Harui" <aharui@> wrote:
> >
> > 1. setStyle("indentation", ...)
> > 
> > 2. itemRenderer = new ClassFactory(myTreeRenderer)
> > 
> > 3. If your renderer invalidates the tree it will cancel the tween
> > 
> > 4. Make sure you're using the right methods at the right time
> > (commitProperties, measure, updateDisplayList)
> > 
> > 
> > 
> > ________________________________
> > 
> > From: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of Rafael Faria
> > Sent: Tuesday, February 05, 2008 5:05 PM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] Re: Still Tree
> > 
> > 
> > 
> > For some reason whenever i use setItemIcon on a function set for a
> > iconFunction its behavior is very weird.
> > 
> > --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
> <mailto:flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com>
> > , "Rafael Faria"
> > <rafaelfaria.grupos@> wrote:
> > >
> > > I think is better to post most of my questions and if anyone can
> help
> > > just reply with an answer :)
> > > 
> > > I'm still struggling myself with packages so if someone has a good
> > > article about it or where i can find a good material about
packages
> it
> > > would be very helpful as well.
> > > 
> > > 
> > > 1 - There is anyway to set the indentation of each element? how?
> > > 
> > > 2 - itemRenderer = myTreeRender i get an error... how can i make a
> > > reference inside my TreeCustom class? if i put <custom:MenuTree 
> > > itemRenderer="com.myTreeRendeder" /> it works just fine. But i
want
> to
> > > be able to set it inside the package as a default.
> > > 
> > > 3 - For some reason, when i first open a branch it doesnt play
that
> > > easing animation, but after it open it works just fine... someone
> > > knows why it happens?
> > > 
> > > 4 - I set a mouseevent.double_click and whenever i double click on
a
> > > branch and it opens the leaf icons doesnt apear until i click in
> > > something else. someone knows why it happens too?
> > > 
> > > Well.. i will be here googling trying to find the answers but if
> > > someone knows how to help me it would be great :P
> > > 
> > > thanks
> > >
> >
>

 

Reply via email to