Thanks Doug, I've done just that! Hopefully I'll get some help with a better
titled thread.
Thanks!

On 2/5/07, Doug Lowder <[EMAIL PROTECTED]> wrote:

Here's a complete example that may help.  This is just the first issue,
how to get the item under the mouse on rollover; setting the tree's tooltip
is another story.  You may want to either search the archives (seems like a
possible bug to me), or start a new topic specifically on setting the
tooltip of a tree control.

<?xml version="1.0" encoding="utf-8"?>
<!-- Tree control example. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>

    <mx:Script>
        <![CDATA[
            import mx.events.ListEvent;

            public function onItemRollOver(event: ListEvent) : void {
                ta.text = [EMAIL PROTECTED];
            }
        ]]>
    </mx:Script>

    <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>

    <mx:Panel title="Tree Control Example" height="75%" width="75%"
        paddingTop="10" paddingLeft="10" paddingRight="10"
paddingBottom="10">

        <mx:Label width="100%" color="blue"
            text="Select a node in the Tree control."/>

        <mx:HDividedBox width="100%" height="100%">
            <mx:Tree width="50%" height="100%" labelField="@label"
                itemRollOver="onItemRollOver(event as ListEvent)"
                showRoot="false" dataProvider="{treeData}" />
            <mx:TextArea id="ta" height="100%" width="50%" text=""/>
        </mx:HDividedBox>

    </mx:Panel>
</mx:Application>


--- In [email protected], "Greg Morphis" <[EMAIL PROTECTED]> wrote:
>
> Tried that too, that bombs
> I was doing some searching on dataTipFunction and saw the item:Object
> and thought I'd give it a try.. it doesnt bomb, just fires on the
> parent node not the child
> E.G
> AR
> |___Little Rock
> |________ABC Street
>
>
> it gets triggered on the city instead of the address
>
> item contains the data of the XML apparently... when I just did a
> item.toString();
> depending on the level I was at I saw the XML
>
>
> On 2/5/07, Doug Lowder [EMAIL PROTECTED] wrote:
> > If that code is based on my previous post, the itemRenderer should
> > come from the event, not the item.
> >
> > --- In [email protected], "Greg Morphis" gmorphis@
> > wrote:
> > >
> > > So I tried
> > > private function handleDataTip
> > (item:Object):String{
> > > return
> > [EMAIL PROTECTED];
> > > }
> > >
> > > and this works on the parent node but not the child node..
> > > Am I missing something?
> > >
> > > Thanks
> > >
> > >
> > >
> > > On 2/4/07, Greg Morphis gmorphis@ wrote:
> > > > Do you guys have any examples or know wher I can look for some
> > using
> > > > the itemRenderer to add the toolTip to the node itself?
> > > >
> > > > Thanks
> > > >
> > > > On 2/2/07, Greg Morphis gmorphis@ wrote:
> > > > > Thanks guys, I'll look into doing that.
> > > > > Tracy can you provide an example?
> > > > >
> > > > > Thanks
> > > > >
> > > > > On 2/2/07, Doug Lowder douglowder@ wrote:
> > > > > > Yeah, moving the mouse off the tree and then back again to
> > see the new
> > > > > > toolTip text is exactly what I was talking about. The event
> > fires
> > > > > > correctly, it just seems that dynamically changing the
> > toolTip that
> > > > > > way isn't supported for some reason.
> > > > > >
> > > > > > I also thought that the combination of showDataTips and
> > dataTipField
> > > > > > property settings you have would work, but seems that's no
> > good
> > > > > > either. Check the archives; it's possible that's a known
> > bug in the
> > > > > > tree control.
> > > > > >
> > > > > > You may have to check out Tracy's suggestion of using an
> > itemRenderer
> > > > > > and setting the toolTip on the node itself.
> > > > > >
> > > > > > --- In [email protected], "Greg Morphis"
> > <gmorphis@> wrote:
> > > > > > >
> > > > > > > Hey Doug, thanks for the reply
> > > > > > > That works great, and I think I found the snag..
> > itemRollOver doesnt
> > > > > > fire
> > > > > > > when I move from item to item.. I have to move out of the
> > Tree and
> > > > > > back in
> > > > > > > and on another item for it to change? Is that why you said
> > that the
> > > > > > toolTip
> > > > > > > wasnt want I needed?
> > > > > > >
> > > > > > > I tried playing around with the dataField.. I thought
> > that was
> > > > > > going to be
> > > > > > > the route to go also.. it should be as simple as
> > > > > > > dataTipField="@mgrname" showDataTips="true"
> > > > > > > right?
> > > > > > > That doesnt do anything that I'm aware of. Do you have an
> > example of
> > > > > > using
> > > > > > > that with a Tree element?
> > > > > > >
> > > > > > >
> > > > > > > Thanks again, I've been so frustrated with this today..
> > > > > > >
> > > > > > > On 2/2/07, Doug Lowder <douglowder@> wrote:
> > > > > > > >
> > > > > > > > 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]);
> > > > > > > > }
> > > > > > > >
> > > > > > > > <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"
> > <gmorphis@> 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 gmorphis@ 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 gmorphis@ 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/__locationsT
> > ree_rollOver
> > > > > > > > ()
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > when trying..
> > > > > > > > > > > private function getRSM(event : MouseEvent ):void {
> > > > > > > > > > > locationsTree.toolTip =
> > [EMAIL PROTECTED];
> > > > > > > > > > >
> > > > > > > > > > > }
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Thanks again
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > On 2/2/07, Greg Morphis gmorphis@ 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
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Flexcoders Mailing List
> > > > > > FAQ:
> > http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > > > > > Search Archives: 
http://www.mail-archive.com/flexcoders%<http://www.mail-archive.com/flexcoders%25>
> > 40yahoogroups.com
> > > > > > Yahoo! Groups Links
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> >
> >
> >
> > --
> > Flexcoders Mailing List
> > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
> > Yahoo! Groups Links
> >
> >
> >
> >
>



Reply via email to