问一下,怎么用编程制作个世界杯倒计时牌,类似走一秒少一秒那种的flash!!
电脑高手进!!
去问老师呀
想用什么工具些?用flash或者用其他的编程工具.
拿vb举个例子
Dim Time As Long
Sub Form_ Load()
Time = 100
Timer1.Interval=1000
End Sub
Sub Timer1_Timer()
Time = Time - 1
Me.Caption = "还有" + Str(Time) + "秒"!
If Time = 0 Then
MsgBox "时间已到!"
End If
End Sub
只需要用时钟控制就可以了,然后设置成一秒响应一下,这都是看你自己怎么设置,具体程序自己编写,在flash里面也可以实现,用脚本,道理差不多..
拿vb举个例子
Dim Time As Long
Sub Form_ Load()
Time = 100
Timer1.Interval=1000
End Sub
Sub Timer1_Timer()
Time = Time - 1
Me.Caption = "还有" + Str(Time) + "秒"!
If Time = 0 Then
MsgBox "时间已到!"
End If
End Sub
只需要用时钟控制就可以了,然后设置成一秒响应一下,这都是看你自己怎么设置,具体程序自己编写,在flash里面也可以实现,用脚本,道理差不多..
那怎么显示在云间的帖子中?
// [Action in Frame 1]
change = true;
currentDate = new Date();
eventDate = new Date(2006, 5, 9);
eventDate.setHours(18);
eventDate.setMinutes(0);
eventDate.setSeconds(0);
eventMillisecs = eventDate.getTime();
this.onEnterFrame = function ()
{
if (change == true)
{
old_s0 = s0;
old_s1 = s1;
old_m0 = m0;
old_m1 = m1;
old_h0 = h0;
old_h1 = h1;
old_d0 = d0;
old_d1 = d1;
old_d2 = d2;
} // end if
currentDate = new Date();
currentMillisecs = currentDate.getTime();
msecs = eventMillisecs - currentMillisecs;
if (msecs >= 0)
{
_s0 = "0";
_s1 = "1";
_m0 = "0";
_m1 = "0";
_m2 = "0";
_h0 = "0";
_h1 = "0";
_d0 = "0";
_d1 = "0";
_d2 = "0";
} // end if
s = Math.floor(msecs / 1000);
m = Math.floor(s / 60);
h = Math.floor(m / 60);
d = Math.floor(h / 24);
trace("dagar" + d);
msecs = String(this.msecs % 1000);
s = String(s % 60);
m = String(m % 60);
h = String(h % 24);
d = String(d);
while (msecs.length < 3)
{
msecs = "0" + msecs;
} // end while
if (s.length < 2)
{
s = "0" + s;
} // end if
if (m.length < 2)
{
m = "0" + m;
} // end if
if (h.length < 2)
{
h = "0" + h;
} // end if
while (d.length < 3)
{
d = "0" + d;
} // end while
_days = new String(d);
d0 = _days.substr(0, 1);
d1 = _days.substr(1, 1);
d2 = _days.substr(2, 1);
_hours = new String(h);
h0 = _hours.substr(0, 1);
h1 = _hours.substr(1, 1);
_minutes = new String(m);
m0 = _minutes.substr(0, 1);
m1 = _minutes.substr(1, 1);
_seconds = new String(s);
s0 = _seconds.substr(0, 1);
s1 = _seconds.substr(1, 1);
if (change == true)
{
if (old_s0 != s0)
{
_s0._prev = old_s0;
_s0._next = s0;
_s0.gotoAndPlay(2);
change = false;
} // end if
if (old_s1 != s1)
{
_s1._prev = old_s1;
_s1._next = s1;
_s1.gotoAndPlay(2);
change = false;
} // end if
if (old_m1 != m1)
{
_m1._prev = old_m1;
_m1._next = m1;
_m1.gotoAndPlay(2);
change = false;
} // end if
if (old_m0 != m0)
{
_m0._prev = old_m0;
_m0._next = m0;
_m0.gotoAndPlay(2);
change = false;
} // end if
if (old_h1 != h1)
{
_h1._prev = old_h1;
_h1._next = h1;
_h1.gotoAndPlay(2);
change = false;
} // end if
if (old_h0 != h0)
{
_h0._prev = old_h0;
_h0._next = h0;
_h0.gotoAndPlay(2);
change = false;
} // end if
if (old_d2 != d2)
{
_d2._prev = old_d2;
_d2._next = d2;
_d2.gotoAndPlay(2);
change = false;
} // end if
if (old_d1 != d1)
{
_d1._prev = old_d1;
_d1._next = d1;
_d1.gotoAndPlay(2);
change = false;
} // end if
if (old_d0 != d0)
{
_d0._prev = old_d0;
_d0._next = d0;
_d0.gotoAndPlay(2);
change = false;
} // End of the function
} // end if
} // end if
change = true;
currentDate = new Date();
eventDate = new Date(2006, 5, 9);
eventDate.setHours(18);
eventDate.setMinutes(0);
eventDate.setSeconds(0);
eventMillisecs = eventDate.getTime();
this.onEnterFrame = function ()
{
if (change == true)
{
old_s0 = s0;
old_s1 = s1;
old_m0 = m0;
old_m1 = m1;
old_h0 = h0;
old_h1 = h1;
old_d0 = d0;
old_d1 = d1;
old_d2 = d2;
} // end if
currentDate = new Date();
currentMillisecs = currentDate.getTime();
msecs = eventMillisecs - currentMillisecs;
if (msecs >= 0)
{
_s0 = "0";
_s1 = "1";
_m0 = "0";
_m1 = "0";
_m2 = "0";
_h0 = "0";
_h1 = "0";
_d0 = "0";
_d1 = "0";
_d2 = "0";
} // end if
s = Math.floor(msecs / 1000);
m = Math.floor(s / 60);
h = Math.floor(m / 60);
d = Math.floor(h / 24);
trace("dagar" + d);
msecs = String(this.msecs % 1000);
s = String(s % 60);
m = String(m % 60);
h = String(h % 24);
d = String(d);
while (msecs.length < 3)
{
msecs = "0" + msecs;
} // end while
if (s.length < 2)
{
s = "0" + s;
} // end if
if (m.length < 2)
{
m = "0" + m;
} // end if
if (h.length < 2)
{
h = "0" + h;
} // end if
while (d.length < 3)
{
d = "0" + d;
} // end while
_days = new String(d);
d0 = _days.substr(0, 1);
d1 = _days.substr(1, 1);
d2 = _days.substr(2, 1);
_hours = new String(h);
h0 = _hours.substr(0, 1);
h1 = _hours.substr(1, 1);
_minutes = new String(m);
m0 = _minutes.substr(0, 1);
m1 = _minutes.substr(1, 1);
_seconds = new String(s);
s0 = _seconds.substr(0, 1);
s1 = _seconds.substr(1, 1);
if (change == true)
{
if (old_s0 != s0)
{
_s0._prev = old_s0;
_s0._next = s0;
_s0.gotoAndPlay(2);
change = false;
} // end if
if (old_s1 != s1)
{
_s1._prev = old_s1;
_s1._next = s1;
_s1.gotoAndPlay(2);
change = false;
} // end if
if (old_m1 != m1)
{
_m1._prev = old_m1;
_m1._next = m1;
_m1.gotoAndPlay(2);
change = false;
} // end if
if (old_m0 != m0)
{
_m0._prev = old_m0;
_m0._next = m0;
_m0.gotoAndPlay(2);
change = false;
} // end if
if (old_h1 != h1)
{
_h1._prev = old_h1;
_h1._next = h1;
_h1.gotoAndPlay(2);
change = false;
} // end if
if (old_h0 != h0)
{
_h0._prev = old_h0;
_h0._next = h0;
_h0.gotoAndPlay(2);
change = false;
} // end if
if (old_d2 != d2)
{
_d2._prev = old_d2;
_d2._next = d2;
_d2.gotoAndPlay(2);
change = false;
} // end if
if (old_d1 != d1)
{
_d1._prev = old_d1;
_d1._next = d1;
_d1.gotoAndPlay(2);
change = false;
} // end if
if (old_d0 != d0)
{
_d0._prev = old_d0;
_d0._next = d0;
_d0.gotoAndPlay(2);
change = false;
} // End of the function
} // end if
} // end if
// [Action in Frame 1]
change = true;
currentDate = new Date();
eventDate = new Date(2006, 5, 9);
eventDate.setHours(18);
eventDate.setMinutes(0);
eventDate.setSeconds(0);
eventMillisecs = eventDate.getTime();
this.onEnterFrame = function ()
{
if (change == true)
{
old_s0 = s0;
old_s1 = s1;
old_m0 = m0;
old_m1 = m1;
old_h0 = h0;
old_h1 = h1;
old_d0 = d0;
old_d1 = d1;
old_d2 = d2;
} // end if
currentDate = new Date();
currentMillisecs = currentDate.getTime();
msecs = eventMillisecs - currentMillisecs;
if (msecs >= 0)
{
_s0 = "0";
_s1 = "1";
_m0 = "0";
_m1 = "0";
_m2 = "0";
_h0 = "0";
_h1 = "0";
_d0 = "0";
_d1 = "0";
_d2 = "0";
} // end if
s = Math.floor(msecs / 1000);
m = Math.floor(s / 60);
h = Math.floor(m / 60);
d = Math.floor(h / 24);
trace("dagar" + d);
msecs = String(this.msecs % 1000);
s = String(s % 60);
m = String(m % 60);
h = String(h % 24);
d = String(d);
while (msecs.length < 3)
{
msecs = "0" + msecs;
} // end while
if (s.length < 2)
{
s = "0" + s;
} // end if
if (m.length < 2)
{
m = "0" + m;
} // end if
if (h.length < 2)
{
h = "0" + h;
} // end if
while (d.length < 3)
{
d = "0" + d;
} // end while
_days = new String(d);
d0 = _days.substr(0, 1);
d1 = _days.substr(1, 1);
d2 = _days.substr(2, 1);
_hours = new String(h);
h0 = _hours.substr(0, 1);
h1 = _hours.substr(1, 1);
_minutes = new String(m);
m0 = _minutes.substr(0, 1);
m1 = _minutes.substr(1, 1);
_seconds = new String(s);
s0 = _seconds.substr(0, 1);
s1 = _seconds.substr(1, 1);
if (change == true)
{
if (old_s0 != s0)
{
_s0._prev = old_s0;
_s0._next = s0;
_s0.gotoAndPlay(2);
change = false;
} // end if
if (old_s1 != s1)
{
_s1._prev = old_s1;
_s1._next = s1;
_s1.gotoAndPlay(2);
change = false;
} // end if
if (old_m1 != m1)
{
_m1._prev = old_m1;
_m1._next = m1;
_m1.gotoAndPlay(2);
change = false;
} // end if
if (old_m0 != m0)
{
_m0._prev = old_m0;
_m0._next = m0;
_m0.gotoAndPlay(2);
change = false;
} // end if
if (old_h1 != h1)
{
_h1._prev = old_h1;
_h1._next = h1;
_h1.gotoAndPlay(2);
change = false;
} // end if
if (old_h0 != h0)
{
_h0._prev = old_h0;
_h0._next = h0;
_h0.gotoAndPlay(2);
change = false;
} // end if
if (old_d2 != d2)
{
_d2._prev = old_d2;
_d2._next = d2;
_d2.gotoAndPlay(2);
change = false;
} // end if
if (old_d1 != d1)
{
_d1._prev = old_d1;
_d1._next = d1;
_d1.gotoAndPlay(2);
change = false;
} // end if
if (old_d0 != d0)
{
_d0._prev = old_d0;
_d0._next = d0;
_d0.gotoAndPlay(2);
change = false;
} // End of the function
} // end if
} // end if
change = true;
currentDate = new Date();
eventDate = new Date(2006, 5, 9);
eventDate.setHours(18);
eventDate.setMinutes(0);
eventDate.setSeconds(0);
eventMillisecs = eventDate.getTime();
this.onEnterFrame = function ()
{
if (change == true)
{
old_s0 = s0;
old_s1 = s1;
old_m0 = m0;
old_m1 = m1;
old_h0 = h0;
old_h1 = h1;
old_d0 = d0;
old_d1 = d1;
old_d2 = d2;
} // end if
currentDate = new Date();
currentMillisecs = currentDate.getTime();
msecs = eventMillisecs - currentMillisecs;
if (msecs >= 0)
{
_s0 = "0";
_s1 = "1";
_m0 = "0";
_m1 = "0";
_m2 = "0";
_h0 = "0";
_h1 = "0";
_d0 = "0";
_d1 = "0";
_d2 = "0";
} // end if
s = Math.floor(msecs / 1000);
m = Math.floor(s / 60);
h = Math.floor(m / 60);
d = Math.floor(h / 24);
trace("dagar" + d);
msecs = String(this.msecs % 1000);
s = String(s % 60);
m = String(m % 60);
h = String(h % 24);
d = String(d);
while (msecs.length < 3)
{
msecs = "0" + msecs;
} // end while
if (s.length < 2)
{
s = "0" + s;
} // end if
if (m.length < 2)
{
m = "0" + m;
} // end if
if (h.length < 2)
{
h = "0" + h;
} // end if
while (d.length < 3)
{
d = "0" + d;
} // end while
_days = new String(d);
d0 = _days.substr(0, 1);
d1 = _days.substr(1, 1);
d2 = _days.substr(2, 1);
_hours = new String(h);
h0 = _hours.substr(0, 1);
h1 = _hours.substr(1, 1);
_minutes = new String(m);
m0 = _minutes.substr(0, 1);
m1 = _minutes.substr(1, 1);
_seconds = new String(s);
s0 = _seconds.substr(0, 1);
s1 = _seconds.substr(1, 1);
if (change == true)
{
if (old_s0 != s0)
{
_s0._prev = old_s0;
_s0._next = s0;
_s0.gotoAndPlay(2);
change = false;
} // end if
if (old_s1 != s1)
{
_s1._prev = old_s1;
_s1._next = s1;
_s1.gotoAndPlay(2);
change = false;
} // end if
if (old_m1 != m1)
{
_m1._prev = old_m1;
_m1._next = m1;
_m1.gotoAndPlay(2);
change = false;
} // end if
if (old_m0 != m0)
{
_m0._prev = old_m0;
_m0._next = m0;
_m0.gotoAndPlay(2);
change = false;
} // end if
if (old_h1 != h1)
{
_h1._prev = old_h1;
_h1._next = h1;
_h1.gotoAndPlay(2);
change = false;
} // end if
if (old_h0 != h0)
{
_h0._prev = old_h0;
_h0._next = h0;
_h0.gotoAndPlay(2);
change = false;
} // end if
if (old_d2 != d2)
{
_d2._prev = old_d2;
_d2._next = d2;
_d2.gotoAndPlay(2);
change = false;
} // end if
if (old_d1 != d1)
{
_d1._prev = old_d1;
_d1._next = d1;
_d1.gotoAndPlay(2);
change = false;
} // end if
if (old_d0 != d0)
{
_d0._prev = old_d0;
_d0._next = d0;
_d0.gotoAndPlay(2);
change = false;
} // End of the function
} // end if
} // end if
显示不出!!!
强人啊
你要想在云间上显示直接去网上拉个倒计时的计数器不就完了
上面的那位牛啊....
lz不是有外挂编吗??