2011-05-17 4 views
0

J'ai un quiz et quand la bonne réponse est cliqué, je veux montrer un mc réponseFLASH AS2 comment faire un MovieClip visible pendant 1 seconde

donc quand la réponse est cliqué sur un « bon » ou un " x "clignotera pendant 1 seconde.

Je dois fonctions sur pour le droit (célébrer) et un pour mal (wrong_answer)

function celebrate() { 
_root._root.<<<<code to show mc for 1 second>>>>>>>>>> 
_root.triangle_mc.scaleTo(100, 0.4, "easeOutBack", 0, glamour); 
_root.triangle_mc.scaleTo(100, 0.4, "easeOutBack", 3); 
_root.triangle_mc.brightOffsetTo(23, 0.4, "easeOutSine", 0); 
_root.triangle_mc.brightOffsetTo(0, 0.5, "easeOutSine", 3); 
_root.triangle_mc.tween('_y', 370, 0.4, "easeOutBack", 0); 
_root.triangle_mc.tween('_y', 418, 0.4, "easeOutBack", 3); 

} 


function wrong_answer() { 
_root.<<<<code to show mc for 1 second>>>>>>>>>> 
_root.triangle_mc.scaleTo(100, 0.4, "easeOutBack", 0); 
_root.triangle_mc.scaleTo(100, 0.4, "easeOutBack", 3); 
_root.triangle_mc.brightOffsetTo(23, 0.4, "easeOutSine", 0); 
_root.triangle_mc.brightOffsetTo(0, 0.5, "easeOutSine", 3); 
_root.triangle_mc.tween('_y', 370, 0.4, "easeOutBack", 0); 
_root.triangle_mc.tween('_y', 418, 0.4, "easeOutBack", 3); 

}

si quelqu'un peut aider à cette question de montrer un clip mc pendant 1 seconde ??

un grand merci à l'avance pour toute aide

Répondre

3

Vous pouvez utiliser setTimeout pour appeler une fonction après 1 seconde et retirez votre message ou movieClip de l'écran. Quelque chose comme ceci:

myBtn.onRelease = function() 
{ 
    myMC._visible = true; 
    setTimeout(removeMC,1000); // 1000 milliseconds = 1 sec 
} 

function removeMC() 
{ 
    myMC._visible = false; 
} 
Questions connexes