موضوع: درس 136 - كود جاهز لعمل ساعة بعقارب الثواني مع تغيير الألوان.. السويتش ماكس السبت يوليو 07, 2012 12:07 am
فقط عمل موفي كليب movie clip ثم الدخول إلي لوحة البرمجة وعمل لصق للكود التالي كود:
الكود:
onSelfEvent (load) { hColor="0xe00e53"; // Sfee لون الساعة for (i=0,x=100;i<60;i++) this.createEmptyMovieClip("marks_"+i,i+1), this["marks_"+i].moveTo(0,x), this["marks_"+i]._rotation=i*6, this["marks_"+i].lineStyle(i%5?3:4,hColor,x), this["marks_"+i].lineTo(0,x-(i%5?4:7)); for (i=1;i<=3;i++) this.createEmptyMovieClip("teller_"+i,i+x), this["teller_"+i].lineStyle(i==1?3:5,hColor, x), this["teller_"+i].lineTo(0,(x-(i*(i==2?10:15)))*-1); this.onEnterFrame=function() { date_=new Date(); this["teller_"+1]._rotation=date_.getSeconds() *6+date_.getMilliseconds()/1000*6; this["teller_"+2]._rotation=date_.getMinutes()*6+date_.getSeconds ()/10; this["teller_"+3]._rotation=date_.getHours()*30+date_.getMinutes()/2; } }
يمكن تغيير ألوان العقارب بوضع كود اللون الذي تريده وهنا فلاش صغير 22 كيلو يمكن إختيار اللون المناسب وعمل كوبي لكود اللون ووضعه في الكود في المكان الأعلي الموضح. مشاهدة الشرح