View Mode: Normal | Article List
August, 2010 | 1
flash as3: copyChannel
[ 2010-08-19 11:09:23 | Author: liuhuan ]
var bmp:BitmapData = new BitmapData(mOriginal.width, mOriginal.height, true);
bmp.draw(mOriginal);
var b = new BitmapData(mOriginal.width, mOriginal.height, true, 0xff000000);
var r = new BitmapData(mOriginal.width, mOriginal.height, true, 0xff000000);
var g = new BitmapData(mOriginal.width, mOriginal.height, true, 0xff000000 );
b.copyChannel(bmp,
...bmp.draw(mOriginal);
var b = new BitmapData(mOriginal.width, mOriginal.height, true, 0xff000000);
var r = new BitmapData(mOriginal.width, mOriginal.height, true, 0xff000000);
var g = new BitmapData(mOriginal.width, mOriginal.height, true, 0xff000000 );
b.copyChannel(bmp,
Read More...
我的新浪微博地址:t.sina.com.cn/liuhuan
[ 2010-08-13 14:55:27 | Author: liuhuan ]
AS3: Simple email validation
[ 2010-08-12 14:25:21 | Author: liuhuan ]
function validate(param1:TextField):Boolean {
if (param1.text.length >= 7) {
if (param1.text.indexOf("@") > 0) {
if (param1.text.indexOf("@") + 2 < param1.text.lastIndexOf(".")) {
if (param1.text.lastIndexOf(".") < param1.text.length - 2) {
return true;
}
}
}
}
return false;
}
if (param1.text.length >= 7) {
if (param1.text.indexOf("@") > 0) {
if (param1.text.indexOf("@") + 2 < param1.text.lastIndexOf(".")) {
if (param1.text.lastIndexOf(".") < param1.text.length - 2) {
return true;
}
}
}
}
return false;
}
AS3: hitTestPoint
[ 2010-08-12 14:14:05 | Author: liuhuan ]
A small example showing how hitTestPoint works in ActionScript 3.0.
var hitResult:Boolean;
this.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
function onEnterFrameHandler(e:Event) {
if (mLeft.hitTestPoint(mouseX, mouseY, true) ) {
hitResult = true;
} else if (mRight.hitTestPoint(mouseX, mouseY, false) ) {
...this.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
function onEnterFrameHandler(e:Event) {
if (mLeft.hitTestPoint(mouseX, mouseY, true) ) {
hitResult = true;
} else if (mRight.hitTestPoint(mouseX, mouseY, false) ) {
Read More...
AS3: bitmapdata threshold example
[ 2010-08-10 14:30:00 | Author: liuhuan ]
Is there any magic wand tool we can use in Flash? ActionScript 3 provides us a method called threshold. Codes below:
function applyThreshold(mc:MovieClip) {
var NewBitmpapData:BitmapData = new BitmapData(mc.width, mc.height, true, 0);
NewBitmpapData.draw(mc);
var pt:Point = new Point(0, 0);
var NewRect:Rectangle = new
...var NewBitmpapData:BitmapData = new BitmapData(mc.width, mc.height, true, 0);
NewBitmpapData.draw(mc);
var pt:Point = new Point(0, 0);
var NewRect:Rectangle = new
Read More...
http://www.aswing.org/ (Chinese site: http://cn.aswing.org/ )...
Read More...
Quote
AsWing is an Open Source Flash ActionScript GUI framework and library that allows programmers to make their flash application(or RIA) UI easily. Its usage is similar to Java Swing. It provides a set of GUI components, which we intent to implement in pure object oriented ActionScript 2. A pluggable look and feel will be
Read More...
Etam anniversary site
[ 2010-08-03 21:16:12 | Author: liuhuan ]
1










