2 Replies Latest reply on Mar 11, 2009 6:22 PM by

    have error

      i want to build the system which windowedA can connected into windowedB. the code below is from windowed B.
      i have error here which is Access of undefined property myText.
      what should i do?
        • 1. Re: have error
          Level 7

          "iloveflex" <webforumsuser@macromedia.com> wrote in message
          news:gp78bp$qed$1@forums.macromedia.com...
          >i want to build the system which windowedA can connected into windowedB.
          >the
          > code below is from windowed B.
          > i have error here which is Access of undefined property myText.
          > what should i do?

          I don't see any LocalConnection or SharedObject code. Could you point out
          where you're doing whatever you're doing to establish connection?


          1 person found this helpful
          • 2. have error
            i'm not using Local Connection..(i try it before this but i have mystery error which is #2044 error) now, i am using show window function to make it connection.
            this the code from windowA:
            <?xml version="1.0" encoding="utf-8"?>
            <mx:WindowedApplication xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" borderThickness="4" >


            <mx:Script>
            <![CDATA[

            /**
            * @private

            */
            import mx.collections.ArrayCollection;
            import mx.controls.Alert;
            import mx.events.FileEvent;
            import mx.managers.SystemManager;
            import mx.controls.Label;
            import flash.events.StatusEvent;
            import mx.managers.PopUpManager;
            import mx.controls.Text;
            import mx.containers.TitleWindow;
            import flash.geom.Point;

            private var point1:Point = new Point();

            private var fileReference:FileReference = new FileReference()

            private function onLoadText():void
            {
            var f:FileFilter = new FileFilter("Text","*.txt");
            fileReference.browse([f]);
            fileReference.addEventListener(Event.SELECT,onFileSelect);
            fileReference.addEventListener(Event.COMPLETE,onFileComplete);

            }
            private function onFileSelect(event:Event):void
            {
            fileReference.load();
            }

            private function onFileComplete(event:Event):void
            {
            myText.text = fileReference.data.readUTFBytes(fileReference.data.length);
            }

            private function showWindow():void {
            var login:log2=log2(PopUpManager.createPopUp
            ( this, log2, true));

            point1.x=myButton.x;
            point1.y=myButton.y;
            point1=myButton.localToGlobal(point1);
            login.x=point1.x+25;
            login.y=point1.y+25;
            }
            ]]>
            </mx:Script>

            <mx:Panel id="myPanel" width="981" height="544" verticalScrollPolicy="off"
            horizontalScrollPolicy="off" title="Log File" x="10" y="66">
            <mx:TextArea width="963" height="454" id="myText"
            text=""/>

            <mx:ControlBar height="60">
            <mx:ProgressBar id="bar" labelPlacement="bottom" themeColor="#F20D7A"
            minimum="0" visible="true" maximum="100" label="CurrentProgress 0%"
            direction="right" mode="manual" width="100%"/>
            <mx:Button label="Load Text" click="onLoadText()"/>
            <mx:Button id="myButton" label="Filter" click="showWindow();" />
            </mx:ControlBar>
            </mx:Panel>
            <mx:TextInput id="checkcase" x="121" y="8" width="160" borderStyle="outset" editable="true" borderThickness="0"/>
            <mx:Label x="10" y="10" text="Case No:" fontWeight="bold"/>

            </mx:WindowedApplication>

            this the code from windowB:

            <?xml version="1.0" encoding="utf-8"?>
            <mx:WindowedApplication xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" >
            <mx:Script>
            <![CDATA[

            import mx.collections.ArrayCollection;
            import mx.controls.Alert;
            import mx.events.FileEvent;
            import mx.managers.SystemManager;
            import mx.controls.Label;

            private var fileReference:FileReference = new FileReference()

            private function applicationHandler():void
            {
            var stringToSplit:String = myText.text;
            var result:Array = stringToSplit.split(" ");
            var Split:LogReader = new LogReader();

            {
            Split.ip = result[0];
            Split.date = result[3] + result[4];
            Split.method = result[5];
            Split.info = result[6] + result[7];
            Split.url = result[8];
            }

            sourceArray.push(Split);
            ac.refresh();
            }

            private function onSaveText():void
            {
            fileReference.save(myText.text,"myText.txt");
            }
            ]]>

            </mx:Script>
            <mx:DataGrid width="1002" height="568" x="10" y="44">
            <mx:dataProvider>

            <mx:ArrayCollection id="ac">

            <mx:source>
            <mx:Array id="sourceArray" />

            </mx:source>
            </mx:ArrayCollection>
            </mx:dataProvider>
            <mx:columns>
            <mx:DataGridColumn dataField="ip"/>
            <mx:DataGridColumn dataField="date"/>
            <mx:DataGridColumn dataField="method"/>
            <mx:DataGridColumn dataField="info"/>
            <mx:DataGridColumn dataField="url"/>
            </mx:columns>
            </mx:DataGrid>
            <mx:Button x="433.5" y="654" label="Save" click="onSaveText()" width="137" height="26"/>
            </mx:WindowedApplication>

            i have error which is access of undefined property myText..(bold).
            i hope this will make u understand..