resizing DataGrid using flash actionscript

Posted by Vineela | Flash, as3, utils | Saturday 31 January 2009 10:30 am

import fl.controls.DataGrid; 

var dg:DataGrid = new DataGrid();
dg.addColumn("Column1");
dg.addColumn("Column2");
dg.addItem({Column1:"Row 1 Col 1", Column2:"Row 1 Col 2"});
dg.addItem({Column1:"Row 2 Col 1", Column2:"Row 2 Col 2"});

dg.width = 100;
dg.setSize(100,20);
dg.rowCount = dg.length;
dg.move(10, 10);
addChild(dg);
 

DataGrid content using DataProvider with flash actionscript

Posted by Vineela | Flash, as3, utils | Friday 30 January 2009 10:40 am

import fl.controls.DataGrid;
import fl.data.DataProvider;

var dp:DataProvider = new DataProvider();
dp.addItem({Column1:"Row1 Col1", Column2:"Row1 Col2"});
dp.addItem({Column1:"Row2 Col1", Column2:"Row2 Col2"});

var dg:DataGrid = new DataGrid();
dg.addColumn("Column1");
dg.addColumn("Column2");
dg.rowCount = dp.length;
dg.dataProvider = dp;
dg.width = 200;
dg.move(10, 10);
addChild(dg);
 

add horizontal scroll to the DataGrid using flash actionscript

Posted by Vineela | Flash, as3, utils | Thursday 29 January 2009 10:22 am

import fl.controls.DataGrid;
import fl.controls.ScrollPolicy; 

var dg:DataGrid = new DataGrid();
dg.addColumn("Column1");
dg.addColumn("Column2");
dg.addItem({Column1:"Row 1 Col 1", Column2:"Row 1 Col 2"});
dg.addItem({Column1:"Row 2 Col 1", Column2:"Row 2 Col 2"});

dg.horizontalScrollPolicy = ScrollPolicy.ON;
dg.width = 100;
dg.rowCount = dg.length;
dg.move(10, 10);
addChild(dg);
 

create DataGrid instance using flash actionscript

Posted by Vineela | Flash, as3, utils | Wednesday 28 January 2009 10:02 am

import fl.controls.DataGrid; 

var dg:DataGrid = new DataGrid();
dg.addColumn("Column1");
dg.addColumn("Column2");
dg.addItem({Column1:"Row 1 Col 1", Column2:"Row 1 Col 2"});
dg.addItem({Column1:"Row 2 Col 1", Column2:"Row 2 Col 2"});
dg.width = 300;
dg.rowCount = dg.length;
dg.move(10, 10);
addChild(dg);
 

Remove White spaces from string in flash – Actionscript 3 (AS3)

Posted by druva | Flash, Flex, MXML, as3, utils | Monday 12 January 2009 4:06 am

This examples shows how to remove white spaces from the string


 public function removeSpaces(str:String):String {
 if (str == null) { return ''; }
 return str.replace(/\s+/g, '');
 }

This is the complete flex example


<?xml version="1.0" encoding="utf-8"?>
<mx:Application
 xmlns:mx="http://www.adobe.com/2006/mxml"
 layout="absolute">
 <mx:Script>
 <![CDATA[

 public function removeSpaces(str:String):String {
 if (str == null) { return ''; }
 return str.replace(/\s+/g, '');
 }
 public function on_trim_button():void {
 reultText.text = removeSpaces(originalText.text);
 }
 ]]>
 </mx:Script>
 <mx:Button x="74" y="101" label="Trim Spaces" click="on_trim_button()"/>
 <mx:TextArea x="74" y="42" id="originalText" />
 <mx:TextArea x="74" y="157" id="reultText" />
 <mx:Label x="74" y="16" text="Enter Text" width="160"/>
 <mx:Label x="74" y="131" text="Enter Text" width="160"/>
</mx:Application>
 

How to Draw a Square with Flash Actionscript 3.0 – AS3

Posted by druva | Flash, as3, utils | Monday 5 January 2009 1:03 pm

simple Example to draw square using flash actionscript

this example show how to use lineStyle, drawRect, Shape

package druva {

import flash.display.*;

public class drawSquare extends Sprite {

public function drawSquare() {
var canvas:Shape = new Shape( );
canvas.graphics.lineStyle(3, 0xFF0000);
canvas.graphics.drawRect(10,10,100,100);
addChild(canvas);

}
}
}

 

How to Draw a Circle with Flash Actionscript 3.0 – AS3

Posted by Vineela | Flash, Flex, as3, utils | Sunday 4 January 2009 1:14 pm
package druva {

 import flash.display.*;

 public class drawCircle extends Sprite {

 public function drawCircle() {
 var canvas:Shape = new Shape(  );
 canvas.graphics.lineStyle(3, 0xFF0000);
 canvas.graphics.drawCircle(100,100,50);
 addChild(canvas);

 }
 }
}
 

speedup your internet

Posted by druva | System, utils | Friday 2 January 2009 12:10 am

By default windows will reserve you bandwidth up to some extent
to disable that follow these instructions
Note : only for windows

1) Click Start
2) Select Run
3) enter gpedit.msc
4) Click enter
5) Compuer configuration termplates
6) Network
7) QoS Packet Sheduler
8 ) Choose Limit reservable bandwidth properties
9) Choose enabled and enter 0%

Done

Enjoy!!

 

date class using flash action script

Posted by Vineela | Flash, as3, utils | Thursday 1 January 2009 10:45 am

import fl.controls.TextInput;

var my_date:Date = new Date();
var date:String = my_date.toString()

var tI:TextInput = new TextInput();
tI.text = date;
tI.move(20,20);

addChild(tI);