ใจดีโปรเจค

หมวดหมู่ทั่วไป => tutorials-flash => ข้อความที่เริ่มโดย: admin ที่ 30 ตุลาคม 2013, 12:58:29 pm



หัวข้อ: สอน flash ทำปุ่มเล่นและหยุดในปุ่มเดียว
เริ่มหัวข้อโดย: admin ที่ 30 ตุลาคม 2013, 12:58:29 pm
สอน flash ทำปุ่ม เล่น-หยุด ในปุ่มเดียว (http://www.youtube.com/watch?v=4FWTIevevjo#ws)

สคริปปุ่มหยุด (เฟรม 1)
โค๊ด:
function onStop(eventObject:MouseEvent) {
btnStop.removeEventListener(MouseEvent.CLICK, onStop);

MovieClip(root).stop();
this.nextFrame();
}

btnStop.addEventListener(MouseEvent.CLICK, onStop);

stop();

สคริปปุ่มเล่น (เฟรม 2)
โค๊ด:
function onPlay(eventObject:MouseEvent) {
btnPlay.removeEventListener(MouseEvent.CLICK, onPlay);

MovieClip(root).play();
this.prevFrame();
}

btnPlay.addEventListener(MouseEvent.CLICK, onPlay);

FB :https://www.facebook.com/
IG :http://instagram.com/bank_jaidee
twitter :https://twitter.com/bankjaiDee1
G+ : ค้นหาด้วยชื่อ jaiDProject นะครับผม