<esri:PictureMarkerSymbol id="pms_by_url" source="http://resources.arcgis.com/en/help/flex-api/samples/01nq/assets/warningsmall.gif"/>
Solved! Go to Solution.
<?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" applicationComplete="applicationCompleteHandler(event)" minHeight="600" minWidth="955"> <fx:Script> <![CDATA[ import com.esri.ags.symbols.PictureMarkerSymbol; import mx.core.UIComponent; import mx.events.FlexEvent; import mx.managers.PopUpManager; protected function applicationCompleteHandler(event:FlexEvent):void { var loader:Loader = new Loader(); loader.load(new URLRequest("http://resources.arcgis.com/en/help/flex-api/samples/01nq/assets/warningsmall.gif")); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadCompleteHandler); } protected function loadCompleteHandler(event:Event):void { // source is loaded var loaderInfo:LoaderInfo = event.target as LoaderInfo; var pmsSource:Bitmap = loaderInfo.content as Bitmap; var pms:PictureMarkerSymbol = new PictureMarkerSymbol(pmsSource); // For the example var swatch:UIComponent = pms.createSwatch(); PopUpManager.addPopUp(swatch, this); PopUpManager.centerPopUp(swatch); } ]]> </fx:Script> </s:Application>
<?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" applicationComplete="applicationCompleteHandler(event)" minHeight="600" minWidth="955"> <fx:Script> <![CDATA[ import com.esri.ags.symbols.PictureMarkerSymbol; import mx.core.UIComponent; import mx.events.FlexEvent; import mx.managers.PopUpManager; protected function applicationCompleteHandler(event:FlexEvent):void { var loader:Loader = new Loader(); loader.load(new URLRequest("http://resources.arcgis.com/en/help/flex-api/samples/01nq/assets/warningsmall.gif")); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadCompleteHandler); } protected function loadCompleteHandler(event:Event):void { // source is loaded var loaderInfo:LoaderInfo = event.target as LoaderInfo; var pmsSource:Bitmap = loaderInfo.content as Bitmap; var pms:PictureMarkerSymbol = new PictureMarkerSymbol(pmsSource); // For the example var swatch:UIComponent = pms.createSwatch(); PopUpManager.addPopUp(swatch, this); PopUpManager.centerPopUp(swatch); } ]]> </fx:Script> </s:Application>
var imageSource:Bitmap = loaderInfo.content as Bitmap;
var loaderContext:LoaderContext = new LoaderContext(); loaderContext.allowCodeImport = true; loaderContext.checkPolicyFile = true; loader.load(new URLRequest(MYURL),loaderContext);