Ranga,This is a bug right now in the 2.x Flex API version. The bug is for embedded swfs, when setting width/height.As a workaround for now, you can either use the swf with the default size or try creating one beforehand with the size you want.Hope that helps.
Yes this is still an issue.
Is this width/height of SWF issue still a bug as of version 3.2 of the Flex API?
<?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>
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.