Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I want to draw sprite on Graphics layer like this:

            var sp:SpriteVisualElement = new SpriteVisualElement();
            sp.graphics.beginFill(0x00ff00,1);
            sp.graphics.drawRoundRect(10,10,100,100,150,150);
            sp.graphics.endFill();
            var myGraphicMarker:Graphic = new Graphic();
            myGraphicMarker.symbol.draw(sp,geom,null,map);
            graphicsLayer.add(myGraphicMarker);

It complaints at line myGraphicMarker.symbol.draw(sp,geom,null,map); about that TypeError: Error #1009: Cannot access a property or method of a null object reference. Can anyone please guide me what to pass instead of null to make this sprite drawn. Thanks

share|improve this question
    
I'm assuming that Graphic is the esri graphic object and not the flash one. symbol is null in this case. therefore you cannot reference it. –  CrazyEnigma Jan 31 '12 at 12:35
    
Thank you for the answer, I solved the problem long ago. –  Omega Cancer Feb 29 '12 at 7:49
    
and what is the answer for the question? –  user6515 Mar 23 '12 at 7:16
    
I extended the com.esri.ags.symbols.Symbol and then drawn on the sprite. –  Omega Cancer Apr 26 '12 at 9:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.