Is this width/height of SWF issue still a bug as of version 3.2 of the Flex API?
I tested with the Flex API 2.3 and can verify that the issue with the SWF not loading is no longer there. Here's the MXML that I used:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:esri="http://www.esri.com/2008/ags" minWidth="955" minHeight="600" viewSourceURL="srcview/index.html">
<fx:Script>
<![CDATA[
import com.esri.ags.Graphic;
import com.esri.ags.events.ExtentEvent;
import com.esri.ags.events.ZoomEvent;
import com.esri.ags.geometry.MapPoint;
import com.esri.ags.symbols.PictureMarkerSymbol;
private var initRes:Number;
private var initW:int;
private var initH:int;
private var pm:PictureMarkerSymbol;
private var pmg:Graphic;
private var myGraphicMarker:Graphic;
private function cc():void
{
map.addEventListener(ExtentEvent.EXTENT_CHANGE, extentChange);
map.centerAt(new MapPoint(-72.185684,41.323083));
function extentChange(event:ExtentEvent):void
{
map.removeEventListener(ExtentEvent.EXTENT_CHANGE, extentChange);
map.addEventListener(ZoomEvent.ZOOM_END, zoomFinished);
map.addEventListener(ExtentEvent.EXTENT_CHANGE, ec);
//'assets/image_swf7.swf'
//'assets/01.png'
pm = new PictureMarkerSymbol('assets/Red_glow.swf');
pm.yoffset = 20;
//if I set this width and height initially, the SWF doesn't load
//if I don't, the width and height aren't registered with the PictureMarkerSymbol...
//so I can't probably resize and offset the SWF
//pm.height = 656;
//pm.width = 975;
pmg = new Graphic(new MapPoint(-72.185684,41.323083));
pmg.mouseEnabled = false;
pmg.mouseChildren = false;
pmg.symbol = pm;
myGraphicsLayer.add(pmg);
myGraphicMarker = new Graphic(new MapPoint(-72.185684,41.323083));
myGraphicsLayer.add(myGraphicMarker);
initRes = map.lods[map.level].resolution;
initW = 975;
initH = 656;
}
}
private function zoomFinished(event:ZoomEvent):void
{
trace("zoom finished");
pm.height = initH * 1/(map.lods[map.level].resolution/initRes);
pm.width = initW * 1/(map.lods[map.level].resolution/initRes);
pmg.height = initH * 1/(map.lods[map.level].resolution/initRes);
pmg.width = initW * 1/(map.lods[map.level].resolution/initRes);
trace(pm.height);
trace(pm.width);
//pm.xoffset = -(initW * 1/(map.lods[map.level].resolution/initRes)) / 2;
//pm.yoffset = (initH * 1/(map.lods[map.level].resolution/initRes)) / 2;
}
private function ec(event:ExtentEvent):void
{
trace("extent changed");
pm.height = initH * 1/(map.lods[map.level].resolution/initRes);
pm.width = initW * 1/(map.lods[map.level].resolution/initRes);
pmg.height = initH * 1/(map.lods[map.level].resolution/initRes);
pmg.width = initW * 1/(map.lods[map.level].resolution/initRes);
trace(pm.height);
trace(pm.width);
}
]]>
</fx:Script>
<esri:Map id="map" level="7" load="cc()" >
<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />
<esri:GraphicsLayer id="myGraphicsLayer" />
</esri:Map>
</s:Application>