flash 拼音发音标准小程序(未完善版本)

最近做了一个无聊的拼音发音小程序,功能很简单,只是外部加载音频,进行一些简单的交互使用。当中有一些音没有发音到,因为找不到相关的音频。所以发音不到。

  1. package 
  2. {
  3.     import flash.display.MovieClip;
  4.     import flash.events.*;
  5.     import flash.media.*;
  6.     import flash.net.*;
  7.     public class Pinyin extends MovieClip
  8.     {
  9.         private var sound:Sound;
  10.         public function Pinyin()
  11.         {
  12.             b.addEventListener(MouseEvent.MOUSE_DOWN,b_down);
  13.             p.addEventListener(MouseEvent.MOUSE_DOWN,p_down);
  14.             m.addEventListener(MouseEvent.MOUSE_DOWN,m_down);
  15.             f.addEventListener(MouseEvent.MOUSE_DOWN,f_down);
  16.             d.addEventListener(MouseEvent.MOUSE_DOWN,d_down);
  17.             t.addEventListener(MouseEvent.MOUSE_DOWN,t_down);
  18.             n.addEventListener(MouseEvent.MOUSE_DOWN,n_down);
  19.             l.addEventListener(MouseEvent.MOUSE_DOWN,l_down);
  20.             g.addEventListener(MouseEvent.MOUSE_DOWN,g_down);
  21.             k.addEventListener(MouseEvent.MOUSE_DOWN,k_down);
  22.             h.addEventListener(MouseEvent.MOUSE_DOWN,h_down);
  23.             j.addEventListener(MouseEvent.MOUSE_DOWN,j_down);
  24.             q.addEventListener(MouseEvent.MOUSE_DOWN,q_down);
  25.             xx.addEventListener(MouseEvent.MOUSE_DOWN,x_down);
  26.             zh.addEventListener(MouseEvent.MOUSE_DOWN,zh_down);
  27.             ch.addEventListener(MouseEvent.MOUSE_DOWN,ch_down);
  28.             sh.addEventListener(MouseEvent.MOUSE_DOWN,sh_down);
  29.             r.addEventListener(MouseEvent.MOUSE_DOWN,r_down);
  30.             z.addEventListener(MouseEvent.MOUSE_DOWN,z_down);
  31.             c.addEventListener(MouseEvent.MOUSE_DOWN,c_down);
  32.             s.addEventListener(MouseEvent.MOUSE_DOWN,s_down);
  33.             a.addEventListener(MouseEvent.MOUSE_DOWN,a_down);
  34.             o.addEventListener(MouseEvent.MOUSE_DOWN,o_down);
  35.             e.addEventListener(MouseEvent.MOUSE_DOWN,e_down);
  36.             i.addEventListener(MouseEvent.MOUSE_DOWN,i_down);
  37.             u.addEventListener(MouseEvent.MOUSE_DOWN,u_down);
  38.             v.addEventListener(MouseEvent.MOUSE_DOWN,v_down);
  39.             ai.addEventListener(MouseEvent.MOUSE_DOWN,ai_down);
  40.             ei.addEventListener(MouseEvent.MOUSE_DOWN,ei_down);
  41.             ao.addEventListener(MouseEvent.MOUSE_DOWN,ao_down);
  42.             ou.addEventListener(MouseEvent.MOUSE_DOWN,ou_down);
  43.             ia.addEventListener(MouseEvent.MOUSE_DOWN,ia_down);
  44.             ie.addEventListener(MouseEvent.MOUSE_DOWN,ie_down);
  45.             ua.addEventListener(MouseEvent.MOUSE_DOWN,ua_down);
  46.             uo.addEventListener(MouseEvent.MOUSE_DOWN,uo_down);
  47.             iao.addEventListener(MouseEvent.MOUSE_DOWN,iao_down);
  48.             iou.addEventListener(MouseEvent.MOUSE_DOWN,iou_down);
  49.             uai.addEventListener(MouseEvent.MOUSE_DOWN,uai_down);
  50.             uei.addEventListener(MouseEvent.MOUSE_DOWN,uei_down);
  51.             an.addEventListener(MouseEvent.MOUSE_DOWN,an_down);
  52.             ian.addEventListener(MouseEvent.MOUSE_DOWN,ian_down);
  53.             uan.addEventListener(MouseEvent.MOUSE_DOWN,uan_down);
  54.             van.addEventListener(MouseEvent.MOUSE_DOWN,van_down);
  55.             en.addEventListener(MouseEvent.MOUSE_DOWN,en_down);
  56.             In.addEventListener(MouseEvent.MOUSE_DOWN,In_down);
  57.             un.addEventListener(MouseEvent.MOUSE_DOWN,un_down);
  58.             vn.addEventListener(MouseEvent.MOUSE_DOWN,vn_down);
  59.             ang.addEventListener(MouseEvent.MOUSE_DOWN,ang_down);
  60.             iang.addEventListener(MouseEvent.MOUSE_DOWN,iang_down);
  61.             uang.addEventListener(MouseEvent.MOUSE_DOWN,uang_down);
  62.             ong.addEventListener(MouseEvent.MOUSE_DOWN,ong_down);
  63.             eng.addEventListener(MouseEvent.MOUSE_DOWN,eng_down);
  64.             ing.addEventListener(MouseEvent.MOUSE_DOWN,ing_down);
  65.             ueng.addEventListener(MouseEvent.MOUSE_DOWN,ueng_down);
  66.             iong.addEventListener(MouseEvent.MOUSE_DOWN,iong_down);
  67.         }
  68.         private function b_down(e:MouseEvent):void
  69.         {
  70.             LoadSound("Pinyin/b的读音.mp3");
  71.         }
  72.         private function p_down(e:MouseEvent):void
  73.         {
  74.             LoadSound("Pinyin/p的读音.mp3");
  75.         }
  76.         private function m_down(e:MouseEvent):void
  77.         {
  78.             LoadSound("Pinyin/m的读音.mp3");
  79.         }
  80.         private function f_down(e:MouseEvent):void
  81.         {
  82.             LoadSound("Pinyin/f的读音.mp3");
  83.         }
  84.         private function d_down(e:MouseEvent):void
  85.         {
  86.             LoadSound("Pinyin/d的读音.mp3");
  87.         }
  88.         private function t_down(e:MouseEvent):void
  89.         {
  90.             LoadSound("Pinyin/t的读音.mp3");
  91.         }
  92.         private function n_down(e:MouseEvent):void
  93.         {
  94.             LoadSound("Pinyin/n的读音.mp3");
  95.         }
  96.         private function l_down(e:MouseEvent):void
  97.         {
  98.             LoadSound("Pinyin/l的读音.mp3");
  99.         }
  100.         private function g_down(e:MouseEvent):void
  101.         {
  102.             LoadSound("Pinyin/g的读音.mp3");
  103.         }
  104.         private function k_down(e:MouseEvent):void
  105.         {
  106.             LoadSound("Pinyin/k的读音.mp3");
  107.         }
  108.         private function h_down(e:MouseEvent):void
  109.         {
  110.             LoadSound("Pinyin/h的读音.mp3");
  111.         }
  112.         private function j_down(e:MouseEvent):void
  113.         {
  114.             LoadSound("Pinyin/j的读音.mp3");
  115.         }
  116.         private function q_down(e:MouseEvent):void
  117.         {
  118.             LoadSound("Pinyin/q的读音.mp3");
  119.         }
  120.         private function x_down(e:MouseEvent):void
  121.         {
  122.             LoadSound("Pinyin/x的读音.mp3");
  123.         }
  124.         private function zh_down(e:MouseEvent):void
  125.         {
  126.             LoadSound("Pinyin/zh的读音.mp3");
  127.         }
  128.         private function ch_down(e:MouseEvent):void
  129.         {
  130.             LoadSound("Pinyin/ch的读音.mp3");
  131.         }
  132.         private function sh_down(e:MouseEvent):void
  133.         {
  134.             LoadSound("Pinyin/sh的读音.mp3");
  135.         }
  136.         private function r_down(e:MouseEvent):void
  137.         {
  138.             LoadSound("Pinyin/r的读音.mp3");
  139.         }
  140.         private function z_down(e:MouseEvent):void
  141.         {
  142.             LoadSound("Pinyin/z的读音.mp3");
  143.         }
  144.         private function c_down(e:MouseEvent):void
  145.         {
  146.             LoadSound("Pinyin/c的读音.mp3");
  147.         }
  148.         private function s_down(e:MouseEvent):void
  149.         {
  150.             LoadSound("Pinyin/s的读音.mp3");
  151.         }
  152.         //
  153.         private function a_down(e:MouseEvent):void
  154.         {
  155.             LoadSound("Pinyin/a的读音.mp3");
  156.         }
  157.         private function o_down(e:MouseEvent):void
  158.         {
  159.             LoadSound("Pinyin/o的读音.mp3");
  160.         }
  161.         private function e_down(e:MouseEvent):void
  162.         {
  163.             LoadSound("Pinyin/e的读音.mp3");
  164.         }
  165.         private function i_down(e:MouseEvent):void
  166.         {
  167.             LoadSound("Pinyin/i的读音.mp3");
  168.         }
  169.         private function u_down(e:MouseEvent):void
  170.         {
  171.             LoadSound("Pinyin/u的读音.mp3");
  172.         }
  173.         private function v_down(e:MouseEvent):void
  174.         {
  175.             LoadSound("Pinyin/ü的读音.mp3");
  176.         }
  177.         private function ai_down(e:MouseEvent):void
  178.         {
  179.             LoadSound("Pinyin/ai的读音.mp3");
  180.         }
  181.         private function ei_down(e:MouseEvent):void
  182.         {
  183.             LoadSound("Pinyin/ei的读音.mp3");
  184.         }
  185.         private function ao_down(e:MouseEvent):void
  186.         {
  187.             LoadSound("Pinyin/a的读音.mp3");
  188.             
  189.         }
  190.         private function ou_down(e:MouseEvent):void
  191.         {
  192.             LoadSound("Pinyin/ou的读音.mp3");
  193.         }
  194.         private function ia_down(e:MouseEvent):void
  195.         {
  196.             LoadSound("Pinyin/ia的读音.mp3");
  197.         }
  198.         private function ie_down(e:MouseEvent):void
  199.         {
  200.             LoadSound("Pinyin/ie的读音.mp3");
  201.         }
  202.         private function ua_down(e:MouseEvent):void
  203.         {
  204.             LoadSound("Pinyin/ua的读音.mp3");
  205.         }
  206.         private function uo_down(e:MouseEvent):void
  207.         {
  208.             LoadSound("Pinyin/uo的读音.mp3");
  209.         }
  210.         private function ve_down(e:MouseEvent):void
  211.         {
  212.             LoadSound("Pinyin/üe的读音.mp3");
  213.         }
  214.         private function iao_down(e:MouseEvent):void
  215.         {
  216.             LoadSound("Pinyin/iao的读音.mp3");
  217.         }
  218.         private function iou_down(e:MouseEvent):void
  219.         {
  220.             LoadSound("Pinyin/iou的读音.mp3");
  221.         }
  222.         private function uai_down(e:MouseEvent):void
  223.         {
  224.             LoadSound("Pinyin/uai的读音.mp3");
  225.         }
  226.         private function uei_down(e:MouseEvent):void
  227.         {
  228.             LoadSound("Pinyin/uei的读音.mp3");
  229.         }
  230.         private function an_down(e:MouseEvent):void
  231.         {
  232.             LoadSound("Pinyin/an的读音.mp3");
  233.         }
  234.         private function ian_down(e:MouseEvent):void
  235.         {
  236.             LoadSound("Pinyin/ian的读音.mp3");
  237.         }
  238.          
  239.         private function uan_down(e:MouseEvent):void
  240.         {
  241.             LoadSound("Pinyin/uan的读音.mp3");
  242.         }
  243.         private function van_down(e:MouseEvent):void
  244.         {
  245.             LoadSound("Pinyin/üan的读音.mp3");
  246.         }
  247.         private function en_down(e:MouseEvent):void
  248.         {
  249.             LoadSound("Pinyin/en的读音.mp3");
  250.         }
  251.         private function In_down(e:MouseEvent):void
  252.         {
  253.             LoadSound("Pinyin/in的读音.mp3");
  254.         }
  255.         private function un_down(e:MouseEvent):void
  256.         {
  257.             LoadSound("Pinyin/un的读音.mp3");
  258.         }
  259.         private function vn_down(e:MouseEvent):void
  260.         {
  261.             LoadSound("Pinyin/ün的读音.mp3");
  262.         }
  263.         private function ang_down(e:MouseEvent):void
  264.         {
  265.             LoadSound("Pinyin/ang的读音.mp3");
  266.         }
  267.         private function iang_down(e:MouseEvent):void
  268.         {
  269.             LoadSound("Pinyin/iang的读音.mp3");
  270.         }
  271.         private function uang_down(e:MouseEvent):void
  272.         {
  273.             LoadSound("Pinyin/uang的读音.mp3");
  274.         }
  275.         private function ong_down(e:MouseEvent):void
  276.         {
  277.             LoadSound("Pinyin/ong的读音.mp3");
  278.         }
  279.         private function eng_down(e:MouseEvent):void
  280.         {
  281.             LoadSound("Pinyin/eng的读音.mp3");
  282.         }
  283.         private function ing_down(e:MouseEvent):void
  284.         {
  285.             LoadSound("Pinyin/ing的读音.mp3");
  286.         }
  287.         private function ueng_down(e:MouseEvent):void
  288.         {
  289.             LoadSound("Pinyin/ueng的读音.mp3");
  290.         }
  291.         private function iong_down(e:MouseEvent):void
  292.         {
  293.             LoadSound("Pinyin/iong的读音.mp3");
  294.         }
  295.         private function LoadSound(path:String):void
  296.         {
  297.             sound=new Sound();
  298.             sound.load(new URLRequest(path));
  299.             sound.addEventListener(Event.COMPLETE, PlaySound);
  300.         }
  301.         private function PlaySound(e:Event):void
  302.         {
  303.             sound.play();
  304.         }
  305.     }
  306. }
  307. 制作过程: 加载一些音频,使用flash 媒体包 Sound 的应用外部加载。
  308. 当中还可以处理加载失败的情况,这里没有添加,这里只是作一个简单交互使用。 同样我们创意发挥一点问别人一下
  309. 这样的程序能够帮到人吗?
  310. 如果可以,这样我们的激情就会出来了。功能就越强大

 

 

 

 

下载地址:http://dl4.csdn.net/fd.php?i=12918774252377&s=d3356349dbddd51919df82fef3b04fb5

你可能感兴趣的:(Flash)