ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[¤À¨É] ÅýFlash°Êµe²£¥ÍµêÀÀ¶Ã¼Æ­È

[¤À¨É] ÅýFlash°Êµe²£¥ÍµêÀÀ¶Ã¼Æ­È

ÅýFlash°Êµe²£¥ÍµêÀÀ¶Ã¼Æ­È

¦WºÙ¡Grandom()

¨Ï¥Î¥Øªº¡G¨ú±o¤¶©ó 0 ¨ì 1 ¤§¶¡ªºµêÀÀ¶Ã¼Æ­È

random ¤èªk²£¥ÍªºµêÀÀ¶Ã¼Æ¤¶©ó 0 ¨ì 1 ¤§¶¡, §Y¶Ç¦^ªº¼Æ¦r¥i¥H¬O 0, ¦ý¬O¤@«ß¤p©ó 1¡]¥]¬A 0 ¦ý¤£¥]¬A 1)¡C

»yªk¡GMath. random()

½d¨Ò¡G
  1. myNum = Math. random();

  2. ¶Ã¼Æ¨ú±o¤¶©ó 0 ¨ì 1 ¤§¶¡ªº¼Æ­È¦s¤JÅÜ¼Æ myNum ¤¤¡C

  3. myNum = Math.floor( Math. random() * 13 + 1 ) ;

  4. ¶Ã¼Æ¨ú±o¤¶©ó 1 ¨ì 13 ¤§¶¡ªº¾ã¼Æ­È¦s¤JÅÜ¼Æ myNum ¤¤¡C
½Æ»s¥N½X
½d¨Ò¾Ç²ß¡G¶Ã¼ÆÂY»ë¤l

§Q¥Î for °j°é±Ô­z¶Ã¼Æ¿ï¥X 3 ­Ó¤¶©ó 1~6 ªº¼Æ­È¡]Math.floor(Math.random() *6+1)¡^, °t¦X¨ú±oªº¼Æ­ÈÅã¥Ü¹ïÀ³ªº MC ¼v®æ, ¨Ã¨Ì¶Ã¼Æ¨ú±oªº 3 ­Ó¼Æ­È¦X­p¨Ó¨M©w¹CÀ¸µ²ªG¡C







½d¨Ò­ì©l½X¡G
  1. function myRandom(){
  2. var randomX=Math.floor(Math.random() *6+1);
  3. return randomX;
  4. }

  5. try_btn.addEventListener("click", try_dic);
  6. function try_dic(me:MouseEvent){
  7. var total=0;
  8. num=myRandom();
  9. dic1_mc.gotoAndStop(num);
  10. total+=num;
  11. num=myRandom();
  12. dic2_mc.gotoAndStop(num);
  13. total+=num;
  14. num=myRandom();
  15. dic3_mc.gotoAndStop(num);
  16. total+=num;
  17. if (total==18){
  18. succ_mc.gotoAndPlay(2);
  19. }
  20. }
½Æ»s¥N½X
ActionScript 3.0 ºë½o½d¨ÒÃã¨å


¥þ·sªº ActionScript 3.0 »yªk, ¶Õ¥²§ïÅܱz³]­p FLASH °Êµeªº¤è¦¡¡C¥»®Ñºë¿ï³Ì±`¥Îªº ActionScript «ü¥O, ¥i¨Ì»yªk¤ÀÃþ¡B½d¨Ò¥\¯à©Î¦r¥À¬d§ä, ¬O±z³]­p FLASH °Êµe®É¤£¥i©Î¯Êªº³Ì¨ÎÀ°¤â¡C
¡¼¥«­±¤W³Ìºë½oªº°Ñ¦Ò¤u¨ã®Ñ¡C¤£·|Åý¬\ÀêµL¨ý¡B¤S«p¤S­«¡B¨S¤H¬Ý±oÀ´ªº«ü¥O¤â¥U, ¦¨¬°±zºë¶iªº»Ùê¡C
¡¼ºë¿ï³Ì±`¥Îªº ActionScript «ü¥O, ¥i¨Ì»yªk¤ÀÃþ¡B½d¨Ò¥\¯à©Î¦r¥À¬d§ä¡C
¡¼·f°t¹Ï¤å¸Ñ»¡»P³Ìºë½oªº½d¨Ò¥Ü½d, Åý±z¤£¦ý¬Ý±oÀ´, Áٯన¤Wª¾¹D­n«ç»ò¥Î¡C
¡¼Â²©öªºActionScript »yªk¤Jªù¤Î°ò¦Æ[©À,§U±z§Ö³t¤F¸ÑActionScript 3.0 ªº¨Ï¥Î¤è¦¡¡C
¡¼®Ñªþ¥úºÐ¤¤ªþ¦³ FLASH CS3 ¸Õ¥Îª©, ¨Ñ±z¦w¸Ë½m²ß»P¨Ï¥Î¡C
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

        ÀR«ä¦Û¦b : ¤H¥Í³Ì¤jªº¦¨´N¬O±q¥¢±Ñ¤¤¯¸°_¨Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD