1. Trang chủ
  2. » Giáo án - Bài giảng

Lenh cho dong ho dem lui

3 544 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Lenh cho dong ho dem lui
Thể loại tiểu luận
Định dạng
Số trang 3
Dung lượng 26,5 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Trang 1

// Action script

// [Action in Frame 1]

function down()

{

if (min != 0 || sec != 0)

{

sec;

if (sec < 0)

{

sec = 59;

min;

} // end if

if (min == 0 && sec <= time)

{

sound_ding.start();

} // end if

seco = String(sec);

minu = String(min);

output = 60 * min + sec;

percent = Math.round(output / input * 100); display = String(percent) + "%";

_root.bar._xscale = percent;

if (seco.length < 2)

{

seco = "0" + seco;

} // end if

if (minu.length < 2)

{

minu = "0" + minu;

} // end if

}

else if (min == 0 && sec == 0 && clic > 0) {

timeding.selectable = false;

timeout = "H?t gi?";

display = "";

sound_end.start();

clic = 0;

_root.ok_btn.enabled = false;

_root.pause_btn.enabled = false;

} // end else if

} // End of the function

Stage.showMenu = false;

var min = 3;

var sec = 0;

var time = 0;

var input = 0;

var output = 0;

var percent = 0;

_root.bar._visible = false;

var input0 = 0;

var clic = 0;

timeding.restrict = "0-9";

timeding.maxChars = 2;

var sound_end = new Sound();

sound_end.attachSound("tada");

var sound_ding = new Sound();

sound_ding.attachSound("ding");

Trang 2

timeout = "";

_root.ok_btn.onRelease = function () {

min = minu;

sec = seco;

time = tmding;

timeout = "";

if (clic == 0)

{

input = 60 * min + sec * 1;

input0 = input;

++clic;

}

else

{

input = input0;

} // end else if

_root.bar._visible = true;

if (min != 0 || sec != 0)

{

timeding.selectable = false;

ID = setInterval(down, 1000); this.enabled = false;

} // end if

};

_root.pause_btn.onRelease = function () {

clearInterval(ID);

_root.ok_btn.enabled = true;

};

_root.cancel_btn.onRelease = function () {

minu = "03";

seco = "00";

tmding = "00";

clearInterval(ID);

_root.ok_btn.enabled = true;

_root.pause_btn.enabled = true; timeding.selectable = true;

timeout = "";

display = "";

_root.bar._visible = false;

_root.bar._xscale = 100;

percent = 0;

input0 = 0;

clic = 0;

};

_root.timeding.onSetFocus = function () {

tmding = "";

_root.ok_btn.enabled = true;

};

_root.timeding.onKillFocus = function () {

if (tmding.length == 0)

{

tmding = "00";

}

else if (tmding.length == 1)

Trang 3

{

tmding = "0" + tmding; } // end else if

};

Ngày đăng: 14/06/2013, 01:25

TỪ KHÓA LIÊN QUAN

w