试着用FLASH结合ASP做计数器,结果发现当页面刷新时FLASH计数器没有变化,但是数据库和ASP页面+1了,除非将当前的页面关闭,然后重新打开IE,刷新一遍,就可以看到FLASH计数器的数字发生了变化。目前已经确定ASP和数据库没有错误,我想应该是FLASH部分的ACTIONSCRIPT中的错误吧!但是不知道错在哪里。
具体做法如下:
MC的做法是在时间线中插入10帧,每一帧填写一个数字(从0-9),命名为“num”。
回到SCENE中,打开Library。拖出6个“num”符号,用Ctrl+K调整位置,让它们之间的距离保持相等。打开菜单Modify >Instance面板,把它们从左到右命名为“100000”“10000”“1000”“100”“10”“1”,在第3帧处插入关键帧。新建一个层命名为“Action”,分别在1、2帧用F6插入关键帧。
在“Action”层第1帧加入Action(如下):
count = 0;
tellTarget ("1") {
gotoAndStop (1);
}
tellTarget ("10") {
gotoAndStop (1);
}
tellTarget ("100") {
gotoAndStop (1);
}
tellTarget ("1000") {
gotoAndStop (1);
}
tellTarget ("10000") {
gotoAndStop (1);
}
tellTarget ("100000") {
gotoAndStop (1);
}
loadVariables ("counter.asp", "");
第2帧的Action(如下):
if (count<>0) {
tellTarget ("/1") {
stop ();
j = /:count.length;
i = /:count.charAt(j-1);
gotoAndStop (++i);
}
tellTarget ("/10") {
stop ();
j = /:count.length;
i = /:count.charAt(j-2);
gotoAndStop (++i);
}
tellTarget ("/100") {
stop ();
j = /:count.length;
i = /:count.charAt(j-3);
gotoAndStop (++i);
}
tellTarget ("/1000") {
stop ();
j = /:count.length;
i = /:count.charAt(j-4);
gotoAndStop (++i);
}
tellTarget ("/10000") {
stop ();
j = /:count.length;
i = /:count.charAt(j-5);
gotoAndStop (++i);
}
tellTarget ("/100000") {
stop ();
j = /:count.length;
i = /:count.charAt(j-6);
gotoAndStop (++i);
}
stop ();
} else {
gotoAndStop (1);
}
第3帧的Action(如下):
loadVariables ("counter.asp", "");
var count1 = count;
if (count1>count) {
tellTarget ("/1") {
stop ();
j = /:count1.length;
i = /:count1.charAt(j-1);
gotoAndStop (++i);
}
tellTarget ("/10") {
stop ();
j = /:count1.length;
I = /:count1.charAt(j-2);
gotoAndStop (++i);
}
tellTarget ("/100") {
stop ();
j = /:count1.length;
i = /:count1.charAt(j-3);
gotoAndStop (++i);
}
tellTarget ("/1000") {
stop ();
j = /:count1.length;
i = /:count1.charAt(j-4);
gotoAndStop (++i);
}
tellTarget ("/10000") {
stop ();
j = /:count1.length;
i = /:count1.charAt(j-5);
gotoAndStop (++i);
}
tellTarget ("/100000") {
stop ();
j = /:count1.length;
i = /:count1.charAt(j-6);
gotoAndStop (++i);
}
} else {
gotoAndStop (2);
}
如果有谁知道错在哪里请告之!!!不胜感激!!!

E-mail:
jeff_yuong@sohu.com QQ:
4272727