0 Replies Latest reply on Sep 11, 2007 11:35 AM by kilyas2007

    Error #2044: Unhandled StatusEvent:. level=error, code=

    kilyas2007 Level 1
      I am writing an application, which has a grid of addresses so that once you click a particular address you get the map displayed. But what happens is that I get the following error


      Error #2044: Unhandled StatusEvent:. level=error, code=
      The code is as follows:-
      <?xml version="1.0"?>
      <!-- dpcontrols/DataGridSort.mxml -->
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
      creationComplete="initDP();" width="100%" height="100%"
      >

      <mx:Script>
      <![CDATA[
      import mx.events.DataGridEvent;
      import mx.collections.*;
      import mx.managers.PopUpManager;
      import mx.containers.Panel;
      import mx.controls.SWFLoader;
      import mx.containers.ControlBar;
      import mx.containers.Panel;
      import mx.containers.VBox;
      import mx.controls.Button;
      import mx.controls.Label;
      import mx.controls.Spacer;
      import mx.controls.TextInput;
      import mx.managers.PopUpManager;

      // Declare storage variables and initialize the simple variables.
      // The data provider collection.
      private var myDPColl:ArrayCollection;
      private var panel:Panel;

      private var myDP:Array = [
      {Address:'14, Badwin Lane', City:'carmel',
      Zip:46032, State: "IN"},
      {Address:'1786, Jackson Road', City:'Carmel',
      Zip:46032, State: "IN"},
      {Address:'231 S La Salle St', City:'Chicago',
      Zip:60604, State: "IL"},
      {Address:'233 S Wacker Dr', City:'Chicago',
      Zip:60604, State: "IL"},
      {Address:'14 E Jackson Blvd', City:'Chicago',
      Zip:60604, State: "IL"}
      ];

      //Initialize the DataGrid control with sorted data.
      private function initDP():void {
      myDPColl = new ArrayCollection(myDP);
      myGrid.dataProvider=myDPColl;
      myGrid.rowCount=myDPColl.length +1;

      panel = new Panel();
      panel.title = "My Title";
      panel.addChild(yahooMap1);

      var cb:ControlBar = new ControlBar();
      var s:Spacer = new Spacer();
      var b1:Button = new Button();
      var b2:Button = new Button();
      b1.label = "OK";
      b1.addEventListener(MouseEvent.CLICK, closePopUp);
      b2.label = "Cancel";
      b2.addEventListener(MouseEvent.CLICK, closePopUp);
      s.percentWidth = 100;
      cb.addChild(s);
      cb.addChild(b1);
      cb.addChild(b2);
      panel.addChild(cb);
      }

      private function closePopUp(evt:MouseEvent):void {
      PopUpManager.removePopUp(panel);
      }
      public function displayForm():void {
      PopUpManager.addPopUp(panel, this, true);
      PopUpManager.centerPopUp(panel);
      getMap(myGrid.selectedItem.Address, myGrid.selectedItem.City, myGrid.selectedItem.State, myGrid.selectedItem.Zip);
      }



      import mx.controls.TextInput;
      import mx.managers.PopUpManager;


      [Bindable]
      public var myArray:Array;

      private var _locLis:LocalConnection;
      private var _locSend:LocalConnection;

      // On map initialize
      private function initApp():void {
      yahooMap1.source = "yahoo/YahooMap.swf";
      initCom();

      }

      // Initialize local connection
      private function initCom():void {

      _locLis = new LocalConnection();
      _locLis.allowDomain("*");
      _locLis.client = this;
      _locLis.connect("swf9Lis");
      _locSend = new LocalConnection();
      }

      public function sendData(strMethod:String, ... args):void {
      _locSend.send("swf8Lis", strMethod, args);
      }


      public var targetComponent:TextInput;

      private function removeMe():void {
      PopUpManager.removePopUp(this);
      }

      public function getMap( inpAddress:String, inpCity:String, inpState:String, inpZip:String):void {
      initApp();
      var arrAddress:Array = new Array(inpAddress, inpCity, inpState, inpZip);
      sendData("setCenterByAddressAndZoom", arrAddress.join(",") + ":~:4:~:0");
      }
      ]]>
      </mx:Script>


      <mx:DataGrid id="myGrid" width="100%" click="displayForm()">
      <mx:columns>
      <mx:DataGridColumn minWidth="120" dataField="Address" />
      <mx:DataGridColumn minWidth="200" dataField="City" />
      <mx:DataGridColumn width="75" dataField="Zip" />
      <mx:DataGridColumn width="75" dataField="State"
      headerText="In Stock"/>
      </mx:columns>
      </mx:DataGrid>

      <mx:Panel title="Yahoo! Maps" width="0%" height="0%">
      <mx:SWFLoader id="yahooMap1" showBusyCursor="true" />
      </mx:Panel>


      </mx:Application>


      help would be appreciated