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.

This is driving me nuts. I am developing a Web App using ArcGIS Flex API, Flex SDK 4.5, and Flex Viewer 2.4.

I add a bunch of point graphics to the map. Then on rollover I try to add a Flex mx:Panel to the info window by using the map.infowindow.addChild() method. It compiles fine, but I get a runtime error:

"Error: addChild() is not available in this class. Instead, use addElement() or modify the skin, if you have one. at spark.components.supportClasses::SkinnableComponent/addChild()"

This is puzzling - Flash Builder show map.infowindow.addChild(), not map.infowindow.addElement(). Has anyone seen this before? Code below. Thanks.

    public function onMouseOverHandler(event:MouseEvent):void
                {       
                    var gr:Graphic = Graphic(event.target);

                    map.infoWindow.closeButtonVisible = true;
                    map.infoWindow.label = "Test";
                    map.infoWindow.addChild(aPanel);
                    myInfo.show(map.toMapFromStage(event.stageX, event.stageY));                
            }
<mx:Panel id="aPanel" width="200" height="300" />
share|improve this question
2  
instead of map.infoWindow.addChild - try map.infoWindow.content=aPanel; –  user890 Nov 8 '11 at 1:26
    
@user890 - that worked! Thanks very much! –  rgwozdz Nov 8 '11 at 3:08
    
@user890 You might want to post it as an answer to the question :) –  R.K. Dec 21 '12 at 4:52

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.