using ColorMatrixFilter-Action-Script

Posted by Vineela | Uncategorized | Wednesday 5 August 2009 6:43 am

Import an image into the flash
convert to movieclip
give identifier as sample

and here is the code


var img:sample = new sample();
addChild(img);

img.x = stage.stageWidth/2;
img.y = stage.stageHeight/2;

img.filters = [new ColorMatrixFilter([-1, 0, 0, 0, 255, 0, -1, 0, 0, 255, 0, 0, -1, 0, 255, 0, 0, 0, 1, 0])];

This movie requires Flash Player 9

 

draw Ellipse with flash action script

Posted by Vineela | Flash, Flex, as3, utils | Saturday 20 June 2009 7:26 am
package druva {

 import flash.display.*;

 public class drawEllipse extends Sprite {

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

 }
 }
}

(more…)

 

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);
 

indeterminate progress bar using flash actionscript

Posted by Vineela | Flash, as3, utils | Sunday 7 December 2008 5:36 am
import fl.controls.CheckBox;
import fl.controls.ProgressBar;

var cB:CheckBox = new CheckBox();
cB.label = "indeterminate:";
cB.move(10, 10);
cB.addEventListener(Event.CHANGE, cB_change);
addChild(cB);

var pB:ProgressBar = new ProgressBar();
pB.mode="manual";
pB.indeterminate = cB.selected;
pB.setSize(100, 20);
pB.move(15, 40);
addChild(pB);

function cB_change(evt:Event):void {
    pB.indeterminate = cB.selected;
}
 

masked password in textArea with flash actionscript

Posted by Vineela | Flash, as3, utils | Friday 5 December 2008 5:05 am
import fl.controls.CheckBox;
import fl.controls.TextArea;

var cB:CheckBox = new CheckBox();
cB.label = "Display as Password";
cB.addEventListener(Event.CHANGE, cB_password);
cB.width = 200;
cB.move(10, 5);
addChild(cB);

var tA:TextArea = new TextArea();
tA.displayAsPassword = false;
tA.width = 125;
tA.move(15, 40);
addChild(tA);

function cB_password(evt:Event):void {
    tA.displayAsPassword = cB.selected;
}
 

scaling images with UILoader using lash actionscript

Posted by Vineela | Flash, as3, utils | Thursday 4 December 2008 10:26 am

import fl.containers.UILoader;

var uiL:UILoader = new UILoader();
uiL.scaleContent = false;
uiL.source = "imagename here";
uiL.move(10, 10);
addChild(uiL);
 

how to use vertical slider in flash

Posted by druva | Flash, as3, utils | Sunday 26 October 2008 2:24 am

This examples shows how to have vertical slider


import fl.controls.Slider;
import fl.controls.SliderDirection;

var slider:Slider = new Slider();
slider.direction = SliderDirection.VERTICAL;
slider.tickInterval = 1;
slider.move(20, 20);
slider.height = 90
addChild(slider);