<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" viewSourceURL="src/EmbeddingImages/index.html" layout="horizontal" width="626" height="626">
<mx:Image id="imageID" source="1.PNG" x="55" complete="image_bitmap(event);" mouseDown="image_click(event)"/>
<mx:Script>
<![CDATA[
import mx.graphics.BitmapFill;
import mx.controls.Alert;
import flash.display.Bitmap;
private var bm:Bitmap;
private var bmd:BitmapData;
private function image_click(e:MouseEvent):void
{
var color:int = bmd.getPixel(e.localX, e.localY);
Alert.show(color.toString(16).toUpperCase());
}
private function image_bitmap(e:Event):void
{
bm = imageID.content as Bitmap;
bmd = new BitmapData(imageID.contentWidth, imageID.contentHeight);
bmd.draw(bm.bitmapData);
}
]]>
</mx:Script>
</mx:Application>
Thursday, September 24, 2009
Thursday, September 17, 2009
Creating the Column chart dynamically
Creating the Column chart dynamically
private function getData():ArrayCollection
{
var arr:Array = [];
arr.push({Month:"Jan", Profit:500});
arr.push({Month:"Feb", Profit:800});
arr.push({Month:"Mar", Profit:1000});
arr.push({Month:"Apr", Profit:700});
arr.push({Month:"May", Profit:900});
return new ArrayCollection(arr);
}
public function CreateColumnChart():void
{
Alert.show("CreateColumnChart");
var colmnChart:ColumnChart = new ColumnChart();
colmnChart.dataProvider =getData();
var catAxis:CategoryAxis = new CategoryAxis();
catAxis.categoryField = "Month";
colmnChart.horizontalAxis = catAxis;
var col:ColumnSeries = new ColumnSeries();
col.yField = "Profit";
col.xField = "Month";
colmnChart.series = [col];
colmnChart.visible = true;
hBox1.addChild(colmnChart);
}
private function getData():ArrayCollection
{
var arr:Array = [];
arr.push({Month:"Jan", Profit:500});
arr.push({Month:"Feb", Profit:800});
arr.push({Month:"Mar", Profit:1000});
arr.push({Month:"Apr", Profit:700});
arr.push({Month:"May", Profit:900});
return new ArrayCollection(arr);
}
public function CreateColumnChart():void
{
Alert.show("CreateColumnChart");
var colmnChart:ColumnChart = new ColumnChart();
colmnChart.dataProvider =getData();
var catAxis:CategoryAxis = new CategoryAxis();
catAxis.categoryField = "Month";
colmnChart.horizontalAxis = catAxis;
var col:ColumnSeries = new ColumnSeries();
col.yField = "Profit";
col.xField = "Month";
colmnChart.series = [col];
colmnChart.visible = true;
hBox1.addChild(colmnChart);
}
Tuesday, September 8, 2009
Getting Sharepoint list item using lamda expression
SPSite objSPSite = new SPSite(@"http://server:portno/sites/myExample");
SPWeb objSPWeb = objSPSite.OpenWeb("mk");
SPList objSPList = objSPWeb.Lists["EmployeeList"];
IEnumerable oSPListItemEnum = objSPList.Items.OfType();
foreach (SPListItem objSPListItem in oSPListItemEnum.Where(x => x["ows_Status"].ToString() == "Closed" ))
{
Console.WriteLine(objSPListItem["Name"].ToString());
}
SPWeb objSPWeb = objSPSite.OpenWeb("mk");
SPList objSPList = objSPWeb.Lists["EmployeeList"];
IEnumerable
foreach (SPListItem objSPListItem in oSPListItemEnum.Where
{
Console.WriteLine(objSPListItem["Name"].ToString());
}
Subscribe to:
Posts (Atom)