You may want to look at the dataTipFunction property of Tree instead of
using toolTip, since I don't think toolTip will give you the results you
want. That said, you can use the following to get the tree item under
the mouse:
import mx.events.ListEvent;
public function onItemRollOver(event: ListEvent) : void {
trace([EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> );
}
<mx:Tree itemRollOver="onItemRollOver(event as ListEvent)"
... />
Assuming your XML dataprovider looks similar to the following:
<mx:XMLList id="treeData">
<node label="Mail Box">
<node label="Inbox">
<node label="Marketing"/>
<node label="Product Management"/>
<node label="Personal"/>
</node>
<node label="Outbox">
<node label="Professional"/>
<node label="Personal"/>
</node>
<node label="Spam"/>
<node label="Sent"/>
</node>
</mx:XMLList>
--- In [email protected], "Greg Morphis" <[EMAIL PROTECTED]> wrote:
>
> can anyone assist me in this?
> I've tried using itemRollOver, no luck, I can only get it on click.
> Does anyone know if it's possible to get the tree item that the mouse
is over?
> Thanks
>
> On 2/2/07, Greg Morphis [EMAIL PROTECTED] wrote:
> > anyone?
> > Is there anyway to capture the leaf that the mouse is currently
over?
> >
> > <mx:Tree id="locationsTree"
> > height="100%"
> > width="100%"
> > dataProvider="{ MyModel.getInstance().allLocationsXML }"
> > labelField="@label"
> > defaultLeafIcon="@Embed('/assets/images/icon_a.png')"
> > itemClick="loadLocation( event )">
> >
> > </mx:Tree>
> >
> > I've got a field in my XML called mgrname and would like to make it
> > the toolTip text of the Tree when mousing over the leaves.
> >
> > Thanks
> >
> >
> >
> > On 2/2/07, Greg Morphis [EMAIL PROTECTED] wrote:
> > > BTW, the error message I get is
> > > TypeError: Error #1009: Cannot access a property or method of a
null
> > > object reference.
> > > at
com.alltel.rapid.aopscheduler.view::SearchByLocationView/::getRSM()
> > > at
com.alltel.rapid.aopscheduler.view::SearchByLocationView/__locationsTree\
_rollOver()
> > >
> > >
> > > when trying..
> > > private function getRSM(event : MouseEvent ):void {
> > > locationsTree.toolTip = [EMAIL PROTECTED];
> > >
> > > }
> > >
> > >
> > > Thanks again
> > >
> > >
> > >
> > >
> > >
> > >
> > > On 2/2/07, Greg Morphis [EMAIL PROTECTED] wrote:
> > > > I'm trying to set up a toolTip for the Tree Node and get some
data in
> > > > it from XML..
> > > > Does anyone have experience in doing this?
> > > > I do something like
> > > > rollOver(getName(event)) in the Tree
> > > > however that forces a MouseEvent, which doesn't have the
> > > > selectedTarget method...
> > > >
> > > > I can get the data on click, using
[EMAIL PROTECTED],
> > > > but I want to do it as they roll over the Tree leafs.
> > > >
> > > > Anyways, has anyone done this before and can offer some help?
> > > >
> > > > Thanks
> > > >
> > >
> >
>