Select to view content in your preferred language

Picturemarkersymbol with swf

812
3
12-22-2010 11:59 PM
SamuelH
Emerging Contributor
I am trying to add a symbol on a the Map using picturemarkersymbol of swf.
When I zoom the map. the symbol move , and  do not at the point i added.
But when i using picturemarkersymbol of png, it do not have the matter.
I am using flex esri lib 2.1.

codes:
--------------------as--------------------
//???????
protected function tbbSource_itemClickHandler(event:ItemClickEvent):void
{
switch (event.currentTarget.id)
{
  case "tbbDraw1":
  {
   tbbDraw2.selectedIndex = -1;
   break;
  }
  case "tbbDraw2":
  {
   tbbDraw1.selectedIndex = -1;
   break;
  }
}
if (tbbDraw1.selectedIndex < 0 && tbbDraw2.selectedIndex < 0)
{
  drawTool.deactivate();
}
else
{
  clearTool("drawTool");
  clearSelectGraphics();
  switch (event.item.label)
  {
   case "MAPPOINT":
   {
    var s:PictureMarkerSymbol = new PictureMarkerSymbol("assets/case.swf");
    s.xoffset = -20;
    s.yoffset = 20;
    drawTool.markerSymbol = s;
    drawTool.activate(DrawTool.MAPPOINT);
    break;
   }
   case "POLYLINE":
   {
    drawTool.activate(DrawTool.POLYLINE);
    break;
   }
   case "FREEHAND_POLYLINE":
   {
    drawTool.activate(DrawTool.FREEHAND_POLYLINE);
    break;
   }
   case "POLYGON":
   {
    drawTool.activate(DrawTool.POLYGON);
    break;
   }
   case "FREEHAND_POLYGON":
   {
    drawTool.activate(DrawTool.FREEHAND_POLYGON);
    break;
   }
   case "EXTENT":
   {
    drawTool.activate(DrawTool.EXTENT);
    break;
   }
   case "CIRCLE":
   {
    drawTool.activate(DrawTool.CIRCLE);
    break;
   }
   case "ELLIPSE":
   {
    drawTool.activate(DrawTool.ELLIPSE);
    break;
   }
  }
 
  clearTbb(event.currentTarget.id);
}   
}
--------------------as--------------------

--------------------Declarations--------------------
<esri:DrawTool id="drawTool"
drawEnd="drawTool_drawEndHandler(event)"
fillSymbol="{sfs}"
graphicsLayer="{graphicsLayer}"
lineSymbol="{sls}"
map="{map}"
markerSymbol="{sms}"/>

<esri:PictureMarkerSymbol id="sms" source="@Embed(source='/assets/case.swf)"  xoffset="-20" yoffset="20"  />
--------------------Declarations--------------------
Tags (2)
0 Kudos
3 Replies
MehulChoksey
Esri Contributor
Could you post your code snippet?
0 Kudos
SamuelH
Emerging Contributor
Could you post your code snippet?


I have posted my code!
0 Kudos
MehulChoksey
Esri Contributor
Could you also attach the swf that you are using, since swfs containg mouse event handlers or swf created with previous version might cause problems...
0 Kudos