If the error was in our code then it's a bug.  I'll forward this one on.

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of kosirm2000
Sent: Tuesday, February 21, 2006 2:12 AM
To: [email protected]
Subject: [flexcoders] Tree keyDownHandler problem

I don't know if this is bug or I should write some additional code,
please if somebody can check this. To reproduce this error click on
first tree node to select it, then press Down key several times to get
the last tree node selected, then press Left key to get to the first
node selected again and then press Down key again: debugger message:
TypeError: Error #1009: null has no properties.
        at Tree/Tree::changeEvt()
        at Tree/__tree0_change()
        at flash.events::EventDispatcher/dispatchEvent()
        at
mx.controls.listclasses::ListBase/mx.controls.listclasses:ListBase::fini
shKeySelection()
        at mx.controls.listclasses::ListBase/moveSelectionVertically()
        at mx.controls.listclasses::ListBase/keyDownHandler()
        at mx.controls::List/keyDownHandler()
        at mx.controls::Tree/keyDownHandler()

Here is the mxml file:

<?xml version="1.0" encoding="UTF-8"?>
<mx:Application layout="absolute"
xmlns:mx="http://www.macromedia.com/2005/mxml";>
        <mx:Script>
                <![CDATA[
            import flash.events.*;
            import mx.events.*;
            import mx.controls.*;

            private function changeEvt(event:Event):void {
                forChange.text = [EMAIL PROTECTED];
            }

        private function nodeOpenEvt(event:TreeEvent):void {
            forOpen.text = [EMAIL PROTECTED];
        }
        private function nodeCloseEvt(event:TreeEvent):void {
            forClose.text = [EMAIL PROTECTED];
        }
        public function openAllTreeNodes(node:Object,open:Boolean){
                   tree0.setIsOpen(node,open);
                   var nodeChildren:XMLList = node.children();
                   var nodeChildrenLength:Number =
nodeChildren.length();
                
                   for  (var i:Number = 0; i< nodeChildrenLength; i++) {
                         if (nodeChildren.children()) {
                                 openAllTreeNodes(nodeChildren[i],open);
                         }
                   }
                }
    ]]>
        </mx:Script>
        <mx:XML format="e4x" id="myxml">
                <node label="Test">
                        <node label="Test1"/>
                        <node label="Test2">
                                <node label="Test21"/>
                                <node label="Test22"/>
                                <node label="Test23"/>
                                <node label="Test24"/>
                        </node>
                        <node label="Test3"/>
                        <node label="Test4"/>
                </node>
        </mx:XML>
        <mx:Tree change="changeEvt(event);" height="216" id="tree0"
labelField="@label" nodeClose="nodeCloseEvt(event);"
nodeOpen="nodeOpenEvt(event);" rootVisible="false" width="150" x="154"
y="148">
                <mx:dataProvider>{myxml}</mx:dataProvider>
        </mx:Tree>
        <mx:Label text="Change Event:" x="368" y="148"/>
        <mx:TextArea height="30" id="forChange" width="150" x="337"
y="172"/>
        <mx:Label text="Open Event:" x="375" y="222"/>
        <mx:TextArea height="30" id="forOpen" width="150" x="337"
y="246"/>
        <mx:Label text="Close Event:" x="374" y="296"/>
        <mx:TextArea height="30" id="forClose" width="150" x="337"
y="320"/>
        <mx:Button
click="openAllTreeNodes(tree0.getNodeDisplayedAt(0),true)"
id="openTreeBt" label="Expand" x="239" y="372"/>
        <mx:Button
click="openAllTreeNodes(tree0.getNodeDisplayedAt(0),false)"
id="openTreeBt0" label="Collapse" x="163" y="372"/>
</mx:Application>





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



 




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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to