最近做了一个无聊的拼音发音小程序,功能很简单,只是外部加载音频,进行一些简单的交互使用。当中有一些音没有发音到,因为找不到相关的音频。所以发音不到。
- package
- {
- import flash.display.MovieClip;
- import flash.events.*;
- import flash.media.*;
- import flash.net.*;
- public class Pinyin extends MovieClip
- {
- private var sound:Sound;
- public function Pinyin()
- {
- b.addEventListener(MouseEvent.MOUSE_DOWN,b_down);
- p.addEventListener(MouseEvent.MOUSE_DOWN,p_down);
- m.addEventListener(MouseEvent.MOUSE_DOWN,m_down);
- f.addEventListener(MouseEvent.MOUSE_DOWN,f_down);
- d.addEventListener(MouseEvent.MOUSE_DOWN,d_down);
- t.addEventListener(MouseEvent.MOUSE_DOWN,t_down);
- n.addEventListener(MouseEvent.MOUSE_DOWN,n_down);
- l.addEventListener(MouseEvent.MOUSE_DOWN,l_down);
- g.addEventListener(MouseEvent.MOUSE_DOWN,g_down);
- k.addEventListener(MouseEvent.MOUSE_DOWN,k_down);
- h.addEventListener(MouseEvent.MOUSE_DOWN,h_down);
- j.addEventListener(MouseEvent.MOUSE_DOWN,j_down);
- q.addEventListener(MouseEvent.MOUSE_DOWN,q_down);
- xx.addEventListener(MouseEvent.MOUSE_DOWN,x_down);
- zh.addEventListener(MouseEvent.MOUSE_DOWN,zh_down);
- ch.addEventListener(MouseEvent.MOUSE_DOWN,ch_down);
- sh.addEventListener(MouseEvent.MOUSE_DOWN,sh_down);
- r.addEventListener(MouseEvent.MOUSE_DOWN,r_down);
- z.addEventListener(MouseEvent.MOUSE_DOWN,z_down);
- c.addEventListener(MouseEvent.MOUSE_DOWN,c_down);
- s.addEventListener(MouseEvent.MOUSE_DOWN,s_down);
- a.addEventListener(MouseEvent.MOUSE_DOWN,a_down);
- o.addEventListener(MouseEvent.MOUSE_DOWN,o_down);
- e.addEventListener(MouseEvent.MOUSE_DOWN,e_down);
- i.addEventListener(MouseEvent.MOUSE_DOWN,i_down);
- u.addEventListener(MouseEvent.MOUSE_DOWN,u_down);
- v.addEventListener(MouseEvent.MOUSE_DOWN,v_down);
- ai.addEventListener(MouseEvent.MOUSE_DOWN,ai_down);
- ei.addEventListener(MouseEvent.MOUSE_DOWN,ei_down);
- ao.addEventListener(MouseEvent.MOUSE_DOWN,ao_down);
- ou.addEventListener(MouseEvent.MOUSE_DOWN,ou_down);
- ia.addEventListener(MouseEvent.MOUSE_DOWN,ia_down);
- ie.addEventListener(MouseEvent.MOUSE_DOWN,ie_down);
- ua.addEventListener(MouseEvent.MOUSE_DOWN,ua_down);
- uo.addEventListener(MouseEvent.MOUSE_DOWN,uo_down);
- iao.addEventListener(MouseEvent.MOUSE_DOWN,iao_down);
- iou.addEventListener(MouseEvent.MOUSE_DOWN,iou_down);
- uai.addEventListener(MouseEvent.MOUSE_DOWN,uai_down);
- uei.addEventListener(MouseEvent.MOUSE_DOWN,uei_down);
- an.addEventListener(MouseEvent.MOUSE_DOWN,an_down);
- ian.addEventListener(MouseEvent.MOUSE_DOWN,ian_down);
- uan.addEventListener(MouseEvent.MOUSE_DOWN,uan_down);
- van.addEventListener(MouseEvent.MOUSE_DOWN,van_down);
- en.addEventListener(MouseEvent.MOUSE_DOWN,en_down);
- In.addEventListener(MouseEvent.MOUSE_DOWN,In_down);
- un.addEventListener(MouseEvent.MOUSE_DOWN,un_down);
- vn.addEventListener(MouseEvent.MOUSE_DOWN,vn_down);
- ang.addEventListener(MouseEvent.MOUSE_DOWN,ang_down);
- iang.addEventListener(MouseEvent.MOUSE_DOWN,iang_down);
- uang.addEventListener(MouseEvent.MOUSE_DOWN,uang_down);
- ong.addEventListener(MouseEvent.MOUSE_DOWN,ong_down);
- eng.addEventListener(MouseEvent.MOUSE_DOWN,eng_down);
- ing.addEventListener(MouseEvent.MOUSE_DOWN,ing_down);
- ueng.addEventListener(MouseEvent.MOUSE_DOWN,ueng_down);
- iong.addEventListener(MouseEvent.MOUSE_DOWN,iong_down);
- }
- private function b_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/b的读音.mp3");
- }
- private function p_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/p的读音.mp3");
- }
- private function m_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/m的读音.mp3");
- }
- private function f_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/f的读音.mp3");
- }
- private function d_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/d的读音.mp3");
- }
- private function t_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/t的读音.mp3");
- }
- private function n_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/n的读音.mp3");
- }
- private function l_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/l的读音.mp3");
- }
- private function g_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/g的读音.mp3");
- }
- private function k_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/k的读音.mp3");
- }
- private function h_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/h的读音.mp3");
- }
- private function j_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/j的读音.mp3");
- }
- private function q_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/q的读音.mp3");
- }
- private function x_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/x的读音.mp3");
- }
- private function zh_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/zh的读音.mp3");
- }
- private function ch_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/ch的读音.mp3");
- }
- private function sh_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/sh的读音.mp3");
- }
- private function r_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/r的读音.mp3");
- }
- private function z_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/z的读音.mp3");
- }
- private function c_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/c的读音.mp3");
- }
- private function s_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/s的读音.mp3");
- }
- //
- private function a_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/a的读音.mp3");
- }
- private function o_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/o的读音.mp3");
- }
- private function e_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/e的读音.mp3");
- }
- private function i_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/i的读音.mp3");
- }
- private function u_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/u的读音.mp3");
- }
- private function v_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/ü的读音.mp3");
- }
- private function ai_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/ai的读音.mp3");
- }
- private function ei_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/ei的读音.mp3");
- }
- private function ao_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/a的读音.mp3");
- }
- private function ou_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/ou的读音.mp3");
- }
- private function ia_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/ia的读音.mp3");
- }
- private function ie_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/ie的读音.mp3");
- }
- private function ua_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/ua的读音.mp3");
- }
- private function uo_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/uo的读音.mp3");
- }
- private function ve_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/üe的读音.mp3");
- }
- private function iao_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/iao的读音.mp3");
- }
- private function iou_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/iou的读音.mp3");
- }
- private function uai_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/uai的读音.mp3");
- }
- private function uei_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/uei的读音.mp3");
- }
- private function an_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/an的读音.mp3");
- }
- private function ian_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/ian的读音.mp3");
- }
- private function uan_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/uan的读音.mp3");
- }
- private function van_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/üan的读音.mp3");
- }
- private function en_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/en的读音.mp3");
- }
- private function In_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/in的读音.mp3");
- }
- private function un_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/un的读音.mp3");
- }
- private function vn_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/ün的读音.mp3");
- }
- private function ang_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/ang的读音.mp3");
- }
- private function iang_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/iang的读音.mp3");
- }
- private function uang_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/uang的读音.mp3");
- }
- private function ong_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/ong的读音.mp3");
- }
- private function eng_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/eng的读音.mp3");
- }
- private function ing_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/ing的读音.mp3");
- }
- private function ueng_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/ueng的读音.mp3");
- }
- private function iong_down(e:MouseEvent):void
- {
- LoadSound("Pinyin/iong的读音.mp3");
- }
- private function LoadSound(path:String):void
- {
- sound=new Sound();
- sound.load(new URLRequest(path));
- sound.addEventListener(Event.COMPLETE, PlaySound);
- }
- private function PlaySound(e:Event):void
- {
- sound.play();
- }
- }
- }
- 制作过程: 加载一些音频,使用flash 媒体包 Sound 的应用外部加载。
- 当中还可以处理加载失败的情况,这里没有添加,这里只是作一个简单交互使用。 同样我们创意发挥一点问别人一下
- 这样的程序能够帮到人吗?
- 如果可以,这样我们的激情就会出来了。功能就越强大
下载地址:http://dl4.csdn.net/fd.php?i=12918774252377&s=d3356349dbddd51919df82fef3b04fb5