7 Replies Latest reply on Nov 23, 2010 1:01 AM by MartinHviid

    Error 1067 on implicit coercion of a value

    YuHsin4221123

      Hi,

       

      I would like to ask how to solve the error below.

       

      1067: Implicit coercion of a value of type flash.events:MouseEvent to an unrelated type ilog.maps:MapEvent.

       

      This is my code for .mxml :

       

      <fx:Script>
          <![CDATA[
              import com.ibm.ilog.elixir.maps.MapFeature;
              import factbook.model.CountryData;
              import factbook.*;
              import factbook.model.DefaultData;
              import factbook.view.userdata.AllSentiments;
             
              import mx.containers.TitleWindow;
              import mx.events.ListEvent;
              import mx.graphics.Stroke;
              import mx.managers.PopUpManager;
              import ilog.maps.MapEvent;
              import spark.components.TitleWindow;
              import factbook.model.DataProxy;
                 
          private var facade:ApplicationFacade=ApplicationFacade.getInstance();
                 
                 
              private var titleWindow:AllSentiments;
              private function onFeatureOver(e:MapEvent):void
              {
                  if (e.mapFeature)
                  {
                      var tt:String = '';
                      var cd:CountryData=DataProxy(facade.retrieveProxy('DataProxy')).getCountryData(e.mapFeature.k ey);
                      tt = cd.name
                  }
                  titleWindow = PopUpManager.createPopUp(this, factbook.view.userdata.AllSentiments, true) as AllSentiments;
                  titleWindow._country = tt; 
                  PopUpManager.bringToFront(titleWindow);
                 
              }
          ]]>
      </fx:Script>

       

      <worldmap:World_countriesMap width="100%" height="100%" id="worldMap" allowSelection="false" animationDuration="300" doubleClickEnabled="true" doubleClick="onFeatureOver(event);" zoomableSymbols="false" backgroundAlpha="0" stroke="{new Stroke(0x222222, 1, 1, true, 'none')}">
      </worldmap:World_countriesMap>

       

       

      I am trying to get the country name, when i double click on a specific country.

      However, when I put the fuction "doubleClick="onFeatureOver(event);", it shows "1067: Implicit coercion of a value of type flash.events:MouseEvent to an unrelated type ilog.maps:MapEvent." error.

       

      May I know what the error is about, and how to solve?

       

      Thanks =)