2009-08-18 20:48:56
My homepage: www.liuhuan.com
View Mode: Normal | Article List
Category: resource | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | > | >>

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

Copy text into clipboard in flash (as2, as3)

[ 2010-07-17 14:58:43 | Author: liuhuan ]
System.setClipboard("something");

as2: export JEPG with flash/ASP/PHP

[ 2010-06-12 16:53:36 | Author: liuhuan ]
sourcefile

I'm sure many people are still finding ways to create & export images ...

Read More...

3d carousel

[ 2010-06-12 09:48:41 | Author: liuhuan ]


It's long time since i played with PV3D.
package {
  import flash.display.*;
  import flash.events.*;
  import flash.filters.*;

  import org.papervision3d.materials.*;
  import org.papervision3d.objects.*;
  import org.papervision3d.objects.primitives.*;
  import org.papervision3d.view.BasicView;
  import org.papervision3d.core.proto.*;
...

Read More...