Geçen hafta yaptığımız Action Script 3.0 ile kareler arası gezinme, buton kontrolü, radyo buton kontrolü gibi uygulamaları hem genişletmek hem de geliştirmek adına bu hafta öğrencilere 10 sorudan oluşan bir bilgi yarışması yapmalarını istedim. Yarışma içerisinde sorulara verilen cevaplardan doğru olanlarla yanlış olanları ayrı ayrı toplayıp yarışma sonunda istatistik olarak ekrana vermelerini istedim. Şimdi bu uygulamayı adım adım birlikte yapalım.
Flash Cs5 Action Script 3.0 ile Adım Adım Bilgi Yarışması
1 2 3 4 5 6 7 8 9 10 11 |
stop(); var dogru:Number=0; var yanlis:Number=0; var puan:Number=0 basla.addEventListener (MouseEvent.CLICK, qwee); function qwee (e:MouseEvent) { gotoAndStop(2); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
stop(); ata.addEventListener (MouseEvent.CLICK, islem); function islem (e:MouseEvent) { yanlis = yanlis+Number(1); gotoAndStop(3); } cem.addEventListener (MouseEvent.CLICK, islem1); function islem1 (e:MouseEvent) { yanlis = yanlis+Number(1); gotoAndStop(3); } yılmaz.addEventListener (MouseEvent.CLICK, islem2); function islem2 (e:MouseEvent) { yanlis = yanlis+Number(1); gotoAndStop(3); } sahan.addEventListener (MouseEvent.CLICK, islem3); function islem3 (e:MouseEvent) { dogru = dogru+Number(1); gotoAndStop(3); } |
1 2 3 4 5 6 7 8 9 10 |
stop(); ds.text=String(dogru);//doğru sayısını yaz ys.text=String(yanlis);//yanlış sayısını yaz p.text=String(dogru*Number(10)); // puanı yaz tekrar.addEventListener (MouseEvent.CLICK, d142qq); function d142qq (e:MouseEvent) { gotoAndStop(1); } |
siz de yorum yazın.