bonjour ^^
j'essai de donner un retard a une fonction a l'aide de setTimeout mais je n'y arrive pas du tout, voila mon script :
m = Microphone.get();
attachAudio(m);
m.setUseEchoSuppression(false);
i1x = i1._x;
i1y = i1._y;
onEnterFrame = function (mic) {
i1._yscale = m.activityLevel*0.9;
i1._x = i1x+(Math.random()*m.activityLevel/5);
i1._y = i1y+(Math.random()*m.activityLevel/8);
i1._alpha = m.activityLevel*0.2;
i2._yscale = m.activityLevel*0.4;
i2._alpha = m.activityLevel*0.3;
i3._xscale = i3._yscale = m.activityLevel;
i3._alpha = m.activityLevel*0.7;
i4._xscale = i4._yscale = m.activityLevel;
i4._alpha = m.activityLevel*0.5;
i5._yscale = m.activityLevel*0.9;
i5._alpha = m.activityLevel*0.5;
i6._yscale = m.activityLevel*0.3;
i6._alpha = m.activityLevel*0.2;
i7._yscale = m.activityLevel*0.2;
i7._alpha = m.activityLevel*0.6;
i8._yscale = m.activityLevel*1.5;
if( m.activityLevel>=5 ){
i8._xscale = i8._xscale*(Math.sin*(m.activityLevel/10))
i8._yscale = i8._yscale*(Math.sin*(m.activityLevel/10))
};
i8._alpha = m.activityLevel*0.9;
i9._yscale = m.activityLevel*0.9;
i9._alpha = m.activityLevel*0.3;
i10._xscale = i10._yscale = m.activityLevel;
i10._alpha = m.activityLevel*0.3;
};
i8.onEnterFrame = function () {
setTimeout (mic,500)
};
en fait j'ai des objets qui varient en fonction de l'activité du micro ( ce qui marche bien d'ailleur) mais j'essaie de faire reagir "i8" avec 500ms de retard par rapport au reste, mais ça ne marche pas.
Est-ce que quelqu'un aurait une idée du probleme ?