Daily Archives: March 11, 2011

OO Design Patterns

Creational Design Patterns: Singleton – Ensure that only one instance of a class is created and Provide a global access point to the object. Factory(Simplified version of Factory Method) – Creates objects without exposing the instantiation logic to the client … Continue reading

Rate this:

| 3 Comments

Actionscript Event function for Dynamic Checkboxes

public function setStringData(event:Event):void{ if(event.currentTarget.selected) { selectedTables += “,” + event.currentTarget.label.toString() ; var len:int = selectedTables.length; //selectedTables = selectedTables.substr(1,len); var str:String = selectedTables.substr(0,1); var str1:String = selectedTables.substr(len,len-1); if(str == ‘,’ ){ var len:int = selectedTables.length; selectedTables = selectedTables.substr(1,len); }else if(str1 == … Continue reading

Rate this:

| Leave a comment

Flex/Actionscript Dynamic Checkbox creation with Events

private function createCheckBoxGroup(tablename:String):void { var checkBox:CheckBox; var vb:VBox; var tst:Array =new Array(); containerBox = new Box(); containerBox.id = tablename; containerBox.addEventListener(“click”, setStringData); for(var i:int =0;i<arrColumnNames.length;i++) { checkBox = new CheckBox(); checkBox.id =tablename+"Z"+ i; checkBox.label = arrColumnNames[i].toString(); var tmp:String = arrColumnNames[i].toString(); checkBox.move(200+(i*15), … Continue reading

Rate this:

| Leave a comment

Flex/Actionscript Grid Component

private function AddColumnsToDatagrid():void { dataidqGrid.removeChild(dataGrid); dataGrid = new DataGrid(); dataGrid.percentHeight=100; dataGrid.percentWidth=100; dataGrid.dataProvider =strXML.row; var cols:Array = new Array(); var i:int = 0; for(i;i<strXML.series.name.length();i++) { var dgc:DataGridColumn = new DataGridColumn(); dgc.headerText =strXML.series.name[i].@seriesName; dgc.dataField = strXML.series.name[i]; cols.push(dgc); } dataGrid.columns = cols; dataidqGrid.addChild(dataGrid); … Continue reading

Rate this:

| Leave a comment

Change Colors of the GeoMap Markers

Flex code for change colos of geomap markers: var markerOption:MarkerOptions = new MarkerOptions(); var fillStyle:FillStyle = new FillStyle({color: 0xFF0000}); markerOption.fillStyle = fillStyle;

Rate this:

| Leave a comment

Google GeoMap Event

marker.addEventListener(MapMouseEvent.CLICK, function (event:MapMouseEvent):void { var markerContent:String = marker.getLatLng().toString(); //marker.openInfoWindow(new InfoWindowOptions({contentHTML: markerContent})); var arlat:Array = event.latLng.toString().split(“,”); var y:String = arlat[0].toString(); var x:String = arlat[1].toString(); lat=y; long=x; cityLong=x.split(“)”)[0]; cityLat=y.split(“(“)[1]; dataConnectionfact_id.getFactsData(x,y,answers.selectedValue.toString()); Condition(); });

Rate this:

| Leave a comment