2009-08-18 20:48:56
My homepage: www.liuhuan.com
View Mode: Normal | Article List
August, 2010 | 1

flash as3: copyChannel

[ 2010-08-19 11:09:23 | Author: liuhuan ]
uploads/201008/19_110901_tt.jpg

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,
...

Read More...

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

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) ) {
...

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
...

Read More...

AsWing

[ 2010-08-09 14:42:05 | Author: liuhuan ]
http://www.aswing.org/ (Chinese site: http://cn.aswing.org/ )
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 ]
http://www.etam.com.cn/anniversary/

2 flash games + flash index

uploads/201008/03_211926_untitled1.jpg


Art design: This.Zhang
1