查看: 1121|回复: 7
|
请问这个actionscript哪里出错了,怎么算不出来?
[复制链接]
|
|
请问这是什么问题?
http://img185.imageshack.us/my.php?image=5leadershipstylescalcullm9.swf
on (release) {
p1=0;
t1=0;
mc1.gotoAndStop(5);
}
这个是每一个选择题的键添加的代码;
var p0=0,p1,p2;
var t0=0,t1,t2;
function myPFunction(p1,p2) {
var p0 = p1+p2;
return p0;
}
function myTFunction(t1,t2) {
var t0 = t1+t2;
return t0;
}
trace (p0);
trace (t0);
这个是计算的出答案的;
请问我应该怎么改才能显示到选择题的答案????请帮帮我啊! |
|
|
|
|
|
|
|

楼主 |
发表于 1-7-2007 04:00 PM
|
显示全部楼层
还有我还没做那个开始的键,如果要打开的请右击play~ |
|
|
|
|
|
|
|
发表于 1-7-2007 06:21 PM
|
显示全部楼层
var p0=0,p1,p2;
var t0=0,t1,t2;
function myPFunction(p1,p2) {
var p0 = p1+p2;
return p0;
}
function myTFunction(t1,t2) {
var t0 = t1+t2;
return t0;
}
trace (p0); //你都沒對p0和t0做任何處理, 一定是0了啊
trace (t0);
那麼你的 myPFunction 和 myTFunction 寫來干嘛?
再來是完全看不懂你的p0....這些變數是要來干嘛用的 |
|
|
|
|
|
|
|

楼主 |
发表于 1-7-2007 09:19 PM
|
显示全部楼层
我需要得到P和T的总数来plot graph~
谢谢tomato哈~我试试看看能不能得到结果~ |
|
|
|
|
|
|
|

楼主 |
发表于 1-7-2007 09:35 PM
|
显示全部楼层
|
|
|
|
|
|
|
发表于 2-7-2007 12:11 AM
|
显示全部楼层
~_~"
var p0=0,p1,p2;
var t0=0,t1,t2;
function myPFunction(p1,p2) {
p0 = p1+p2;
}
function myTFunction(t1,t2) {
t0 = t1+t2;
}
myPFunction(1, 2); //這樣你的P0和T0不就賦予值了
myTFunction(3, 0);
trace (p0); //這樣不就有了
trace (t0);
那個圖不難啊, 去參考help的lineTo例子跟著做即可 |
|
|
|
|
|
|
|

楼主 |
发表于 3-7-2007 01:14 PM
|
显示全部楼层
tomato啊,我那个问题还是不行,传去的数据还是0,因为我不是要自定义数据的,结果我试过用别的script还出现更多errors;现在我决定重新做选择题buttons,改去比较明智的radio buttons~
不过还是谢谢你哈!
至于,那个“help的lineTo例子”找不到哦,是因为我用Flash 8.0的关系,不同? |
|
|
|
|
|
|
|
发表于 3-7-2007 10:19 PM
|
显示全部楼层
|
|
|
|
|
|
| |
本周最热论坛帖子
|