I'm kind of new to Flex so this is most likely due to my newness.

I'm trying to redisplay the XML dropped in one tab into a second tab.
The first time u click the "Edit XML" button, I get this error:

TypeError: Error #1009: Cannot access a property or method of a null
object reference.

Now, if I try AGAIN, it works fine. If I refresh the page in the browser
it works fine also. It's just hte first time I hit that 'Edit XML'
button. Any ideas?

Thanks in advance,
Rich

The code:

<?xml version="1.0"?>
<!-- Simple example to demonstrate the TabNavigator layout container.
-->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; >

     <mx:Script>
         <![CDATA[

             private function jumpTab():void {
                 tn.selectedChild = editTab;
                 drawXMLForm();
             }
             private function drawXMLForm():void {
                 xmlForm.text = xmlString.text;
             }
         ]]>
     </mx:Script>

     <mx:Panel title="MAXE 0.01" height="90%" width="90%"
         paddingTop="10" paddingLeft="10" paddingRight="10"
paddingBottom="10">

         <mx:Label width="100%" color="blue"
             text="Select the tabs to change the panel."/>

         <mx:TabNavigator id="tn"  width="100%" height="100%">

             <mx:VBox label="Drop XML" paddingLeft="20" paddingRight="20"
paddingBottom="20" id="dropTab">
                  <mx:Label text="Drop Your XML text right here"/>

                 <mx:TextArea id="xmlString" width="100%"  height="100%"
text="">

                 </mx:TextArea>
                 <mx:HBox width="100%" horizontalAlign="right">
                     <mx:Button label="Edit XML" id="editXML"
click="jumpTab();" />
                 </mx:HBox>

             </mx:VBox>

             <mx:VBox label="Edit XML" id="editTab" paddingLeft="20"
paddingRight="20" paddingBottom="20">
                 <mx:Text id="xmlForm">
                     <mx:text></mx:text>
                 </mx:Text>
             </mx:VBox>

             </mx:TabNavigator>

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


Reply via email to