デジタル時計を配置したい FLASH CS5 でこのインターフェイスを構築し、その MovieClip に MovieClip InstanceName "RELOJ" を作成しました。もう一方のレイヤーには、時計と日付全体のアクション スクリプト (AS3) があります。
ムービークリップをメイン タイムラインに配置して、swf を再生しますが、時計が動いていません。
メインタイムラインにアクションレイヤーを配置して「RELOJ.play()」と書いてみましたが、何も...
そのムービークリップを再生するにはどうすればよいですか?
更新:これは MovieClip 内のコードです。フォントは埋め込まれています。
dateDisplay.addEventListener(Event.ENTER_FRAME,showTime);
diaDisplay.addEventListener(Event.ENTER_FRAME,showDia);
function showTime(event:Event):void {
var myTime:Date = new Date();
var theSeconds=myTime.getSeconds();
var theMinutes=myTime.getMinutes();
var theHours=myTime.getHours();
var ampm:String;
if (theHours>=12) {
ampm="pm";
} else {
ampm="am";
}
if (theHours>=13) {
theHours=theHours-12;
}
if (String(theMinutes).length == 1) {
theMinutes="0"+theMinutes;
}
if (String(theSeconds).length == 1) {
theSeconds="0"+theSeconds;
}
dateDisplay.text =theHours+":"+theMinutes+":"+theSeconds+" "+ampm;
}
function showDia(event:Event):void {
var myDia:Date = new Date();
var dayText:String;
var theDia=myDia.getDay();
var theFechaDia=myDia.getDate();
if(theDia == 0) {
dayText = "Domingo";
} else if(theDia == 1) {
dayText = "Lunes";
} else if(theDia == 2) {
dayText = "Martes";
} else if(theDia == 3) {
dayText = "Miercoles";
} else if(theDia == 4) {
dayText = "Jueves";
} else if(theDia == 5) {
dayText = "Viernes";
} else if(theDia == 6) {
dayText = "Sabado";
}
diaDisplay.text =dayText+" "+theFechaDia;
}