View Mode: Normal | Article List

Michael Jackson, farewell

[ 2009-06-27 11:01:41 | Author: liuhuan ]


I would not ever forget these days i kept watching your VCDs on TV...

I would not ever forget these days i kept listening to your tapes...

I just can not stop loving you!!

Read More...

addFrameScript (as3)

[ 2009-06-23 00:59:44 | Author: liuhuan ]
In as3, it's possible for us to add script to timeline dynamicly.


package {
  import flash.display.*;
  public class AddScript extends MovieClip {
    public function AddScript() {
      addFrameScript(0, frame1, 8, frame9, 15, frame16, 21, frame22, 25, frame26, 28, frame29);
    }
    private function frame1() {
      trace("start");
    }
    private function frame9() {
...

Read More...

Alpha mask (as3)

[ 2009-06-21 10:23:07 | Author: liuhuan ]
Alpha mask is always not easy in flash, though it's so simple in other adobe produts like after effect. We can not simply make alpha mask with timeline orders. By the mergeAlpha parameter in copyPixels method, we can easily make alpha mask in actionscript 3.


var maskerbmp:BitmapData = new BitmapData(masker.width, masker.height, true, 0);
...

Read More...

self-customized EventDispatcher (as3)

[ 2009-06-20 00:47:41 | Author: liuhuan ]
To build a self-customized eventdispatcher in actionscript 3:
package {
  import flash.display.Sprite;
  import flash.events.Event;
  import flash.text.TextField;
  public class MyEventDispatcher extends Sprite {
    public function MyEventDispatcher() {
      addEventListener("OPEN222", handleOpenEvent);
      dispatchEvent(new Event("OPEN222"));
    }
    private function handleOpenEvent(event:Event) {
      txt.text = "OPEN";
    }
  }
}

5 years ago

[ 2009-06-19 19:03:25 | Author: liuhuan ]
uploads/200906/19_190430_img_1698.jpg

as3: SharedObject example

[ 2009-06-19 18:48:23 | Author: liuhuan ]
as3 version:
var so:SharedObject=SharedObject.getLocal("test");
if (so.size==0) {
  // Shared object doesn't exist.
  trace("created...");
  so.data.now = new Date().time;
  so.data.hello="world";
  so.data.foo="bar";
}
var ageMS:Number = new Date().time - so.data.now;
trace("SharedObject was created " + Number(ageMS / 1000 / 60).toPrecision(2) + " minutes ago");
trace("SharedObject is " + so.size + " bytes");
...

Read More...

flash filter

[ 2009-06-17 20:50:20 | Author: liuhuan ]