//创建日期对象mydate mydate = newDate(); 内容来自论文无忧网 www.paper51.com //获取年份,并放在myear变量中 paper51.com
myyear= mydate.getFullYear(); copyright paper51.com //获取月份 paper51.com mymonth =mydate.getMonth()+1; http://www.paper51.com //获取第几天 内容来自www.paper51.com myday = mydate.getDate(); paper51.com //获取小时数值 copyright paper51.com myhour =mydate.getHours(); 内容来自www.paper51.com
//获取分钟数值 paper51.com myminute =mydate.getMinutes(); paper51.com //获取秒数值 内容来自论文无忧网 www.paper51.com
mysecond= mydate.getSeconds(); 内容来自论文无忧网 www.paper51.com
//获取星期的数值 copyright paper51.com myday2 = mydate.getDay(); 内容来自www.paper51.com //利用条件语句将myday的值转换为中文 http://www.paper51.com
if (myday2 == 0){ copyright paper51.com dayname= "日"; http://www.paper51.com
} http://www.paper51.com if(myday2 == 1) { copyright paper51.com dayname= "一"; http://www.paper51.com
} http://www.paper51.com if(myday2 == 2) { 内容来自论文无忧网 www.paper51.com dayname= "二"; paper51.com } paper51.com
if(myday2 == 3) { 内容来自www.paper51.com dayname= "三"; paper51.com
} copyright paper51.com if(myday2 == 4) { 内容来自www.paper51.com dayname= "四"; http://www.paper51.com } 内容来自论文无忧网 www.paper51.com if(myday2 == 5) { 内容来自论文无忧网 www.paper51.com dayname= "五"; 内容来自www.paper51.com } paper51.com
if(myday2 == 6) { copyright paper51.com dayname= "六"; copyright paper51.com } copyright paper51.com //让动态文本框显示日期及时间 paper51.com mytime= myyear+"年"+mymonth+"月"+myday+"日 "+"星期"+dayname+myhour+":"+myminute+":"+mysecond; 内容来自论文无忧网 www.paper51.com }; 内容来自www.paper51.com 4.2.4声音按钮的制作 copyright paper51.com 首先制作一个Control影片剪辑元件与声音绑定,在上面加入脚本语言: 内容来自www.paper51.com
onClipEvent (load){ http://www.paper51.com this._visible =0; http://www.paper51.com _root.soundstatus = "on"; 内容来自www.paper51.com _root.mySound =new Sound(_level0); 内容来自论文无忧网 www.paper51.com _root.mySound2 =new Sound(_level1); paper51.com _root.mySound3 =new Sound(_level2); 内容来自www.paper51.com _root.mySound4 =new Sound(_level3); 内容来自www.paper51.com
_root.mySound5 =new Sound(_level4); copyright paper51.com maxvolume = 100; paper51.com minvolume = 0; copyright paper51.com } copyright paper51.com onClipEvent (enterFrame){ 内容来自www.paper51.com if(_root.soundstatus == "on"){ 内容来自论文无忧网 www.paper51.com
step = 5; paper51.com } http://www.paper51.com if(_root.soundstatus == "off"){ http://www.paper51.com step = -5; 内容来自www.paper51.com } copyright paper51.com maxvolume =maxvolume + step; http://www.paper51.com if (maxvolume> 100){ copyright paper51.com
http://www.paper51.com |