import custom.components.details.SplitDate; import flash.events.MouseEvent; import flash.net.URLRequest; import flash.net.navigateToURL; import mx.controls.Alert; import mx.controls.Label; import mx.controls.Text; [Bindable] private var _baseURL:String; public function set baseURL(value:String):void{_baseURL = value;} public function get baseURL():String{return _baseURL;} private var link:String = new String(); public function set details(collateral:Object):void{ var desc:Text; var keyword_label:Label; //ToDo setters for details section collateral.flag!="None"?flag.text="("+collateral.flag+")":flag.text=""; headerFileName.text = collateral.title; headerCategory.text = collateral.category; fileName.text = collateral.title; category.text = collateral.category; img.styleName=collateral.type.toLowerCase(); if (collateral.keyword_string == ""){ display(keywordWrapper,false); } else{ display(keywordWrapper,true); keywordText.text = collateral.keyword_string.replace(/, /g,"\n"); } if (collateral.products_string == null){ display(productWrapper,false); } else{ display(productWrapper,true); productText.text = collateral.products_string.replace(/, /g,"\n"); } desc = description; desc.text = collateral.description; descriptionWrapper.removeAllChildren(); descriptionWrapper.addChild(new SplitDate(collateral.created_on as Date)); descriptionWrapper.addChild(desc); link = collateral.attachment_list; link = link.substring(link.indexOf("'event:")+7,link.indexOf("'>")); } private function download(evt:MouseEvent):void{ if (link != "") navigateToURL(new URLRequest(baseURL+link)); } private function display(object:Object,value:Boolean):void{ object.includeInLayout = value; object.visible = value; }