发新话题
打印

[分享] 纯代码色盘-----------------------听说名字不长没人看的?????????

纯代码色盘-----------------------听说名字不长没人看的?????????

做涂鸦板时写的,也许不是最简方法,当练习了
var col_str:String;
var cnt = 0;
var unit = 10;
for (col_r=0; col_r<6; col_r++) {
for (col_g=0; col_g<6; col_g++) {
  for (col_b=0; col_b<6; col_b++) {
   var r_str, g_str, b_str:String;
   r_str = (col_r*51).toString(16);
   g_str = (col_g*51).toString(16);
   b_str = (col_b*51).toString(16);
   if (r_str.length<2) {
    r_str = "0"+r_str;
   }
   if (g_str.length<2) {
    g_str = "0"+g_str;
   }
   if (b_str.length<2) {
    b_str = "0"+b_str;
   }
   col_str = "0x"+r_str+g_str+b_str;
   this.createEmptyMovieClip("slot"+cnt, cnt);
   if (col_r<3) {
    this["slot"+cnt]._x = col_g*unit+col_r*6*unit;
    this["slot"+cnt]._y = col_b*unit;
   } else {
    this["slot"+cnt]._x = col_g*unit+(col_r-3)*6*unit;
    this["slot"+cnt]._y = col_b*unit+unit*6;
   }
   this["slot"+cnt].lineStyle(0.5, 0x000000, 100);
   this["slot"+cnt].beginFill(col_str, 100);
   this["slot"+cnt].moveTo(0, 0);
   this["slot"+cnt].lineTo(0, unit);
   this["slot"+cnt].lineTo(unit, unit);
   this["slot"+cnt].lineTo(unit, 0);
   this["slot"+cnt].lineTo(0, 0);
   this["slot"+cnt].endFill();
   this["slot"+cnt].col = col_str;
   this["slot"+cnt].onRollOver = function() {
    this._parent.form._visible = true;
    this._parent.form._x = this._x;
    this._parent.form._y = this._y;
   };
   this["slot"+cnt].onRollOut = function() {
    this._parent.form._visible = false;
   };
   this["slot"+cnt].onDragOver = function() {
    trace(1)
    this._parent.form._visible = true;
    this._parent.form._x = this._x;
    this._parent.form._y = this._y;
   };
   this["slot"+cnt].onDragOut = function() {
    this._parent.form._visible = false;
   };
   cnt++;
  }
}
}
this.createEmptyMovieClip("form", cnt);
this.form.lineStyle(0.5, 0xFFFFFF, 100);
this.form.moveTo(0, 0);
this.form.lineTo(0, unit);
this.form.lineTo(unit, unit);
this.form.lineTo(unit, 0);
this.form.lineTo(0, 0);
this.form._visible = false;
最光荣的牺牲,是英雄的宿命。

TOP

swf文件
晕,按默认分辨率拉伸了,看不到全貌...

[ 本帖最后由 ecnelis 于 2008-1-19 09:24 编辑 ]

附件

色盘.swf (668 Bytes)

2008-1-19 17:16, 下载次数: 124

最光荣的牺牲,是英雄的宿命。

TOP

哦,呵呵,之前我也做了一个...

附件

2。0调色器.swf (925 Bytes)

2008-1-20 19:37, 下载次数: 99

TOP

酷 收录
54371309[请发送:flash8会员问题]
正在更新中..070815   http://zszen.com

TOP

收了

TOP

发新话题