AS簽名等一些常用AS代碼

來源:互聯網
上載者:User
//顯示時間
function get_time() {
var a = this.createEmptyMovieClip("time_show", 200412);
a.createTextField("time_text", 0, 0, 0, 140, 18);
a.time_text.background=true;
a.onEnterFrame = function () {
this.time_text.text = new Date().getFullYear()+"年"+new Date().getMonth()+"月"+new Date().getDay()+"日"+new Date().getHours()+":"+new Date().getMinutes()+":"+new Date().getSeconds();
};
}
get_time();
——————————————————————————
//顯示幀速
function get_fps() {
var a = this.createEmptyMovieClip("fps_show", 100000);
a.createTextField("fps_text", 0, 0, 0, 16, 18);
a.fps_text.background = true;
a._fps = 0;
a.oldtim = getTimer();
a.onEnterFrame = function () {
this._fps = Math.round(1000 / (getTimer() - this.oldtim));
this.oldtim = getTimer();
this.fps_text.text = this._fps;
};
}
get_fps();——————————————————————
//AS填充,並獲得填充區點陣
function get_fill(mc){
var s_j=mc._x;
var e_j=mc._x+mc._width;
var s_i=mc._y;
var e_i=mc._y+mc._height;
//
var a=mc.createEmptyMovieClip("fill",1);
var fill_data=[];
for(var i=0;i<100;i++){
fill_data[i]=[];
for(var j=0;j<25;j++){
if(mc.hitTest(i,j,true)){
a.lineStyle(1,random(0xffffff));
a.moveTo(i,j);
a.lineTo(i+.5,j);
fill_data[i][j]=1;
}else{
fill_data[i][j]=0;
}
}
}
for(var i in fill_data){
fill_data[i]=fill_data[i].join("");
}
fill_data=fill_data.join(",");
trace(fill_data);
return fill_data;
}——————————————————————
//我的AS簽名

//取得填充區,並將資訊存入fill_data(“1”需要表示填充,“0”表示無須填充)
function get_fill(mc){
var s_j=mc._x;
var e_j=mc._x+mc._width;
var s_i=mc._y;
var e_i=mc._y+mc._height;
//
var a=mc.createEmptyMovieClip("fill",1);
var fill_data=[];
for(var i=0;i<100;i++){
fill_data[i]=[];
for(var j=0;j<25;j++){
if(mc.hitTest(i,j,true)){
a.lineStyle(1,random(0xffffff));
a.moveTo(i,j);
a.lineTo(i+.5,j);
fill_data[i][j]=1;
}else{
fill_data[i][j]=0;
}
}
}
for(var i in fill_data){
fill_data[i]=fill_data[i].join("");
}
fill_data=fill_data.join(",");
trace(fill_data);
return fill_data;
}

下面的jh_data就是由函數get_fill(mc)取得的,mc中是被打散的字元,註冊點位於左上方
//我的簽名
function _jh7086() {
var jh_data="0000000000000000000000000, 0000000001100000000000000,0000000001100000000000000, 0000000001100000000001000,0011000001111111111111100, 0011111001111111111111100,0000110000000000000111000, 0000000000000000001110000,0000110000000000011100000, 0000110000000000000000011,0000110000011100011000111, 0000110000111000011100110,0000110011101000111001110, 0000111111001000110001100,0110110100001001100001100, 0111110000001111000111000,0111010000001110000110000, 0000110000111100011110000,0000110011110000111110000, 0000110011100011111111000,0000110001000111100011000, 0000110000000110000011100,0000110000000100000001110, 0000110000000000000000110,0000000000000000000000000, 0000000000000000000000000,0000000000000000000000000, 0000000000000000000000000,0000001111111111111111110, 0000001111111111111111110,0000001000000000000000000, 0110000000000000000000000,0111100000000000001000000, 0011100000000000011100000,0000000000000000110000000, 0000000000000011100000000,0000000000001110000000000, 0011001111111000000000000,0011001111111000000000000, 0011001000011100000000000,0011000000001110000000000,0011000000000111000000000, 0011000000000011110000000,0011000000000001111000000, 0011000000000000010000010,0011000000000000000000111, 0011000000000000000000110,0011111111111111111111110, 0011111111111111111111100,0000000000000000000000000, 0000000000000000000000000,0000000000000000000000000, 0000000000000000000000000,0000010000000000000001000, 0000010001101110001111000,0000010001111110011100000, 0000010001000110011000010,0000010001000110000000011, 0110010001000111111111111,0111010001000111111111111, 0011010001000110000000000,0000010001000110000000000, 0000010001111110111000000,0000010000000000001100110, 0000010000000000000001110,0000000010000000000111100, 0000000010000000011110000,0111111111111111111000000, 0111111111111000000000000,0100000010000000000000000, 0000000011111111111111100,0001000011111111111111110, 0011100010000000000000110,0000110010000000000000110, 0000010010000000000011110,0000000010000000000011100, 0000000000000000000000000,0000000000000000000000000, 0000000000000000000000000,0000000000000000000000000, 0000001110000000000001110,0000001111111111111111110, 0000001000000000000000000,0110000000000000000000000, 0111100000000000001000000,0011110000000000011100000, 0000100000000000111000000,0000000000000011100000000, 0000000000001110000000000,0011001111111000000000000, 0011001111111000000000000,0011001000011100000000000, 0011000000001110000000000,0011000000000111000000000, 0011000000000011110000000,0011000000000001111000000, 0011000000000000010000010,0011000000000000000000111, 0011000000000000000000110, 0011111111111111111111110";
//資料預先處理
jh_data=jh_data.split(",");
for(var i in jh_data){
jh_data[i]=jh_data[i].split("");
}
this.createEmptyMovieClip("jh7086", 1000000);
jh7086.onRelease=function(){
getURL("http://www.webjx.com";,_blank’" target="_blank" >http://www.webjx.com",_blank);
}
jh7086.onEnterFrame=function(){
this.clear();
this.lineStyle();
this.beginFill(0);
this.moveTo(0,0);
this.lineTo(110,0);
this.lineTo(110,32);
this.lineTo(0,32);
this.lineTo(0,0);
this.endFill();
//填字
for(var i=0 ;i<jh_data.length;i++){
for(var j=0 ;j<jh_data[i].length;j++){
if(jh_data[i][j]=="1"){
var col=random(150)+50;
this.lineStyle(2,(col+50)*256*256+col*256+100,100);
this.moveTo(i+4,j+3);
this.lineTo(i+4.5,j+3);
}
}
}
}
}
_jh7086() ;//執行這個函數就得到偶的簽名

相關文章

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。