หน้าแรก > Flash > เขียน Function จับเวลา

เขียน Function จับเวลา

มิถุนายน 2, 2008 ใส่ความเห็น Go to comments

กรณีที่ต้องการกำหนดให้ flash ปิดตัวเอง ในช่วงเวลาที่กำหนด
ที่เฟรมแรก

adjustTime = 0
_root.onEnterFrame = function(){
nowTime = getTime() – adjustTime();
if(nowTime >=19*1000){ // เวลาที่กำหนดในที่นี้ คิดเป็น 19 วินาที
_root.onEnterFrame = undefined;
gotoAndPlay(“blank”)// เฟรมที่เราต้องการให้เล่นต่อเมื่อปิด banner

}
};

และถ้ามีปุ่ม replay แล้วให้เริ่มนับเวลาใหม่
ใส่ script ที่ปุ่ม

on(release){
adjustTime += nowTime;
gotoAndPlay(“เฟรมที่ต้องการให้ย้อนเล่นใหม่”)
}

Categories: Flash ป้ายกำกับ:
  1. ยังไม่มีความเห็น
  1. No trackbacks yet.

ใส่ความเห็น

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / เปลี่ยนแปลง )

Twitter picture

You are commenting using your Twitter account. Log Out / เปลี่ยนแปลง )

Facebook photo

You are commenting using your Facebook account. Log Out / เปลี่ยนแปลง )

Connecting to %s

Follow

Get every new post delivered to your Inbox.