http://www.thaiflashdev.com/forums/index.php?showtopic=9591&st=0&#entry58812นอกจาก filter แล้วมันยังปรับปรุง _่า เ_ว อีกหลายประการ
สำหรับคนที่มี flash 8 ก็เอา code แปะในเฟรมดังนี้
Number.prototype.DecToHex = function() {
var I:Number = Math.floor(this);
var hex:Array = ("0123456789ABCDEF").split("");
var res:String = '';
while ((I /= 16)>16) {
}
while ((I-Math.floor(I))<1 && (I-Math.floor(I))>0) {
res += hex[Math.floor(I)];
I = (I-Math.floor(I))*16;
}
res += hex[I];
if (this != Math.floor(this)) {
trace("Warning: Given number "+this+" was not integer.");
trace(" Integer "+Math.floor(this)+" was used instead.");
}
return res;
};
function cl(val) {
if (val.length == 1) {
tmp = "0"+val;
} else {
tmp = val;
}
return tmp;
}
//**************************
nameMC = 0;
s = 0;
//color = new Array(0x003300, 0x006600, 0x009900, 0x00FF00);
color = new Array(0x0099CC, 0x0066FF, 0x0099FF, 0x00CCFF);
this.onEnterFrame = function() {
for (i=0; i<=5; i++) {
mc = _root.createEmptyMovieClip("digit_"+nameMC, nameMC);
myText = mc.createTextField("text_"+nameMC, nameMC, 0, 0, 20, 20);
myText.text = chr(random(255));
//myText.textColor = color[random(4)];
rr = random(255);
gg = random(255);
bb = random(255);
myText.textColor = "0x"+cl(rr.DecToHex())+cl(gg.DecToHex())+cl(bb.DecToHex());
//mc._x = random(500);
if (a == "go") {
s += 2;
if (s>=500) {
a = "back";
}
} else {
s -= 2;
if (s<=0) {
a = "go";
}
}
mc._x = s;
mc._y = random(-200);
mc.speed = random(10)+10;
mc.onEnterFrame = function() {
this._y += this.speed;
if (this._y>=600) {
removeMovieClip(this);
}
};
nameMC++;
}
แล้ว preview
เป็นโครงสร้างล้ำเลิศของ AS ครับ