1 Reply Latest reply on Oct 5, 2006 4:09 PM by FursterateTom

    LocalConnection object

    FursterateTom
      I am talking to a older version of swf.

      I have a object called mapconnection. This is based on a yahoo map application. The isInitialized does get set to true when the map is ready. Then when I send in the map address it is set to null. I need this variable to find out if the map was initialized so I know when I can send in the address to the yahoo map. Also, is there a way to dispatch an event to tell me when it is initialized?


      package Components.PropViews
      {
      import flash.net.LocalConnection;

      public class MapConnection extends LocalConnection{
      private var isInitialized:Boolean;
      private var index:uint;

      public function MapConnection(server:String = "_flexClient"){
      try {

      connect(server);
      }
      catch (error:ArgumentError)
      {
      // server already created/connected
      }

      }
      public function mapInitialized():void{
      isInitialized = true;
      trace("SearchConnection init")
      trace("init" + " " + isInitialized)
      }
      public function addMarker(address:String,title:String,description:String):void{
      trace("addmarker" + " " + isInitialized)

      try {

      var marker:Object = {index:"House",
      title:title, description:description,
      markerColor:0x990099, strokeColor:0xFFFF00 };
      send("_flashClient","addMarker",
      {address:address, marker:marker});
      }
      catch(error:Error){

      }

      }
      }
      }