I have declared a control containing you tube player that is shown as info window as follows.
<fx:Component className="YouTube_InfoWindowRenderer">
<mx:VBox verticalGap="0" autoLayout="true">
<media:YouTubePlayer id="youTubePlayer" videoID="{data.videoID}" quality1="medium" aspectRatio="widescreen" />
<!--<mx:Label text="Published: {data.published}" paddingTop="0" paddingBottom="0" horizontalCenter="0" />-->
</mx:VBox>
</fx:Component>
On click of the graphics i have created the object of YouTube_InfoWindowRenderer and assign the attribute property. Can you tell me is this correct way the code line below and also same is highlighted in red.
Because every time i see this videoID is blank.
map.infoWindow.data = graphic.attributes;
protected function graphic1_clickHandler(event:MouseEvent):void
{
// TODO Auto-generated method stub
var infoWindowContent:DisplayObject;
var infoWindowRenderer:ClassFactory;
if (event.currentTarget != null)
{
var recreate:Boolean = true;
map.infoWindow.hide();
var graphic:Graphic = Graphic(event.currentTarget);
var infoclickGraphic:Graphic;
infoWindowRenderer = new ClassFactory(YouTube_InfoWindowRenderer);
infoWindowContent = infoWindowRenderer.newInstance();
map.infoWindow.content = infoWindowContent as UIComponent;
map.infoWindow.label = graphic.attributes.title;
map.infoWindow.data = graphic.attributes;
map.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY));
}
}