flash action script ¤@°Ý
±z¬O²Ä
277ÓÂsÄýªÌ
¤j®a¦n, §Ú¬O·s¤â, ¦³¥H¤Uªº°ÝÃD, ½Ð¤j®aÀ°À°¤â¬Ý¤@¤U¬O¤°»òì¦]¥X¿ù.
§Ú¦³Óas file ¤º®e¦p¤U:
class time_counter extends MovieClip
{
var total_time_tf, time_txt, total_time_str, __get__total_time, __get__cur_time, __set__cur_time, __set__total_time;
private function time_counter()
{
super();
total_time_tf = new TextFormat();
total_time_tf.color = 16763904;
time_txt = time_txt;
} // End of the function
function set total_time(num)
{
trace (num);
num = Math.ceil(num % 3600);
total_time_str = this.format_time(num);
time_txt.text = "00:00 / " + total_time_str;
time_txt.setTextFormat(8, 16, total_time_tf);
//return (this.total_time());
null;
} // End of the function
function set cur_time(num)
{
time_txt.text = this.format_time(num) + " / " + total_time_str;
time_txt.setTextFormat(8, 16, total_time_tf);
//return (this.cur_time());
null;
} // End of the function
function format_time(num)
{
var _loc4 = "";
var _loc3 = 1;
while (_loc3 > 0)
{
var _loc1 = Math.floor(num / Math.pow(60, _loc3));
if (_loc1 > 10)
{
_loc4 = _loc4 + (_loc1.toString() + ":");
}
else if (_loc1 < 10)
{
_loc4 = _loc4 + ("0" + _loc1.toString() + ":");
} // end else if
num = num % Math.pow(60, _loc3--);
} // end while
if (num < 10)
{
return (_loc4 + "0" + num.toString());
}
else
{
return (_loc4 + num.toString());
} // end else if
} // End of the function
} // End of Class
¤§«á, §Ú¦b²Ä2Ófile ¼g¤F¤@Ófunction ´Ncall time_counter ¦p¤U:
function show_progress()
{
var _loc1 = ns.time / last_time_num;
if (!isNaN(_loc1))
{
tracker_mc.played = ns.time;
time_counter.cur_time = Math.floor(ns.time);
if (_loc1 >= 1)
{
clearInterval(playing_interval);
} // end if
} // end if
} // End of the function
function getPlayerVersion()
{
var _loc2 = System.capabilities.version;
if (_loc2)
{
_loc2 = getVersion();
} // end if
var _loc1 = _loc2.split(" ");
_loc1 = _loc1[1].split(",");
return (Number(_loc1[0]) + Number(_loc1[1]) / 100 + Number(_loc1[2]) / 10000 + Number(_loc1[3]) / 1000000);
} // End of the function
·í§Ún§â ,fla compile ¦¨ .swf ªº®ÉÔ, ¥L´N¥X¤F¿ù»~¦p¤U:
**Error** Scene=Scene 1, layer=Action Layer, frame=1:Line 16: The property being referenced does not have the static attribute.
time_counter.cur_time = Math.floor(ns.time);
½Ð°Ý¨ì©³§Ú¦b¨ºÓ¦ì¸m¥X¤F¿ù?
The property being referenced does not have the static attribute ³oÓ¿ù»~§Ú¤Wgoogle §ä¹L, ³£¤£¬O¤Ó©ú¥Õ¬O¤°»ò, ½Ð°ª¤âÀ°§Ú¬Ý¬ÝnÂI§ïÓcode, ¦hÁÂ!
¹ê¥Î¬ÛÃö·j´M: google nds av cat it ati property