View Mode: Normal | Article List
我的新浪微博地址: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 ]
We supply spare parts for weaving factory on the web. There are 14,000 items on our web http://www.italywind.com for air jet,projectile,water jet and rapier looms.
We supply both mechanical parts and electronic parts. They are not only for loom but also for jacquard,dobby and accumulator.Each item has one picture with original code number ,specification and price.All the parts are made ...
Read More...
We supply both mechanical parts and electronic parts. They are not only for loom but also for jacquard,dobby and accumulator.Each item has one picture with original code number ,specification and price.All the parts are made ...
Read More...
Copy text into clipboard in flash (as2, as3)
[ 2010-07-17 14:58:43 | Author: liuhuan ]
System.setClipboard("something");