PDA

Просмотр полной версии : Analog meter (random rotation)


q17
23.11.2010, 14:49
Прошу помощи в реализации скрипта, который бы заставил свободно дергаться стрелочку (movie clip), в аналоговом метре.
Many Thanks!

Leonard
24.11.2010, 10:14
onClipEvent(load){
x = 0;
}
onClipEvent(enterFrame){
trace(this._rotation);
if(x == 0){
this._rotation += 1 + Math.random()*10;
if(this._rotation > Math.random()*70){
trace(x);
x = 1;
}
}
if(x == 1){
this._rotation -= 1 + Math.random()*10;
if(this._rotation < -Math.random()*70){
trace(x);
x = 0;
}

}
}