替代方案;“数学随机”;在谷歌广告中(Flash AS2)?
我正在制作一个横幅,它将出现在谷歌广告网络上。然而,谷歌不接受在代码中使用math.random的广告 我发现了一些代码,但它不起作用。我发现最相关的是这个,但对我来说仍然不起作用 有人能帮我吗?它在AS2上是如何工作的 以下是原文:替代方案;“数学随机”;在谷歌广告中(Flash AS2)?,flash,actionscript-2,Flash,Actionscript 2,我正在制作一个横幅,它将出现在谷歌广告网络上。然而,谷歌不接受在代码中使用math.random的广告 我发现了一些代码,但它不起作用。我发现最相关的是这个,但对我来说仍然不起作用 有人能帮我吗?它在AS2上是如何工作的 以下是原文: var pressed = false; var go = function() { width = 300; height = 200; max_snowsize = 20; snowflakes = 15;
var pressed = false;
var go = function() {
width = 300;
height = 200;
max_snowsize = 20;
snowflakes = 15;
for (i=0; i<snowflakes; i++) {
t = attachMovie("snow", "snow"+i, i);
t._alpha = 40+Math.random()*60;
t._x = -(width/2)+Math.random()*(1.5*width);
t._y = -(height/2)+Math.random()*(1.5*height);
t._xscale = t._yscale=50+Math.random()*(max_snowsize*10);
t.k = 1+Math.random()*2;
t.wind = -1.5+Math.random()*(1.4*3);
t.onEnterFrame = mover;
}
};
mover = function() {
this._y += this.k;
this._x += this.wind;
if (this._y>height+10) {
this._y = -20;
}
if (this._x>width+20) {
this._x = -(width/2)+Math.random()*(1.5*width);
this._y = -20;
} else if (this._x<-20) {
this._x = -(width/2)+Math.random()*(1.5*width);
this._y = -20;
}
if(pressed){
this._alpha -= 1;
}
}
// start snow
go();
var pressed=false;
var go=函数(){
宽度=300;
高度=200;
最大雪径=20;
雪花=15;
对于(i=0;i八+10){
这个._y=-20;
}
如果(这是宽度+20){
这个.x=-(宽度/2)+Math.random()*(1.5*宽度);
这个._y=-20;
}否则,如果(这._x如果你能找到一种方法来获取该横幅中的当前时间,请使用该时间值作为种子来运行自定义算法。只有当你获得随机种子时,你才能生成随机种子,甚至可能是你能获得的任何信息,页面视图,在线用户,系统处理器使用情况,(我认为所有这些访问都是受限的。横幅使用as2而不是as3是有原因的),但你可能会发现一些漏洞:)
哦,有一种方法可以捕获用户滚轮的使用情况-我相信这是一个好的种子,或者至少鼠标悬停事件可以成为shore的种子。代码中没有Google
acceptmath.random
?不幸的是Google不接受此代码。他们也没有说明原因。