0
我正在制作将放在Google广告网络上的横幅。但是,Google不接受在代码中使用math.random的广告。取代Google广告(Flash AS2)中的“Math.random”?
我发现了几个代码,但它不起作用。我发现的最相关的是这个,但仍然没有对我工作 http://wondergiant.com/2013/03/random-without-math-random/
任何人都可以帮助我在这如何在AS2上工作?
以下是原帖:
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();
不是'Google'在代码中接受'math.random'吗? – helloflash 2014-11-24 16:47:54
不幸的是Google不接受这段代码,他们也没有说明原因。 – Button 2014-11-25 01:32:24