Loading ...
Sorry, an error occurred while loading the content.

attach a addEventListener to a Object returnd by swfMarkerAdded

Expand Messages
  • larsfreelance
    Hey All, I am working with the as 3.0 classes for the yahoo maps. I would like to know how you can add a addEventListener to a marker added by
    Message 1 of 2 , Mar 6, 2007
    View Source
    • 0 Attachment
      Hey All,

      I am working with the as 3.0 classes for the yahoo maps.
      I would like to know how you can add a addEventListener to a marker
      added by addMarkerByLatLon. I

      I've been looking at the MapEventDispatcher and saw that it is
      dispatching 'swfMarkerAdded'.
      I saw that it returns a Object. But how can i add a addEventListener
      to this Object?


      In my code i add a marker with:
      latLonController.addMarkerByLatLon('CustomSWFMarker',52.3, 5.91,
      {url:'assets/icons/customIcon2.swf', ref:'myMark'});

      I add a listner to the MapEventDispatcher like this:
      mapEventDispatcher.addEventListener('addSWFMarkerByAddress_Result',
      swfMarkerAdded);

      And the function requested looks like this:
      private function swfMarkerAdded(ev:Object):void {
      }

      So this last function is the place where the magic should happen, but
      how?
    • doganation
      Congratulations, you win the first bug award. This is what happens when a method call does not go through the ExternalInterfaceBuffer class we created,
      Message 2 of 2 , Mar 7, 2007
      View Source
      • 0 Attachment
        Congratulations, you win the first bug award. This is what happens
        when a method call does not go through the ExternalInterfaceBuffer
        class we created, elements get dropped. I have it fixed and I will
        do my best to get the powers that be to post the fix tomorrow.

        Thanks,
        Scott

        --- In yws-maps@yahoogroups.com, "larsfreelance" <larsfreelance@...>
        wrote:
        >
        > Hey All,
        >
        > I am working with the as 3.0 classes for the yahoo maps.
        > I would like to know how you can add a addEventListener to a
        marker
        > added by addMarkerByLatLon. I
        >
        > I've been looking at the MapEventDispatcher and saw that it is
        > dispatching 'swfMarkerAdded'.
        > I saw that it returns a Object. But how can i add a
        addEventListener
        > to this Object?
        >
        >
        > In my code i add a marker with:
        > latLonController.addMarkerByLatLon('CustomSWFMarker',52.3, 5.91,
        > {url:'assets/icons/customIcon2.swf', ref:'myMark'});
        >
        > I add a listner to the MapEventDispatcher like this:
        > mapEventDispatcher.addEventListener
        ('addSWFMarkerByAddress_Result',
        > swfMarkerAdded);
        >
        > And the function requested looks like this:
        > private function swfMarkerAdded(ev:Object):void {
        > }
        >
        > So this last function is the place where the magic should happen,
        but
        > how?
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.