الأحد، ١٧ أكتوبر ٢٠١٠

اكشن سكريبت 3 بعض الأكواد لإيقاف المؤقت الزمنى

لإيقاف المؤقت فى أخر فريم




ActionScript 3,
1
23
45
6


//Stops at the last frame
stage.addEventListener(Event.ENTER_FRAME, stopLastFrame);function stopLastFrame(event:Event):void
{   if(this.currentFrame == this.totalFrames)
{stop();
}}







-------------------------------------------------------------------------------------------------

لإيقاف المؤقت بعد التكرار عدد معين من المرات






ActionScript 3,
  1. stage.addEventListener(Event.ENTER_FRAME, stopLastFrame);
  2. function stopLastFrame(event:Event):void
  3. {
  4. if(this.currentFrame == this.totalFrames)
  5. {
  6. if(counter >= 3)
  7. {
  8. stop();
  9. setTimeout(startAgain,3000); }
  10. else
  11. {
  12. counter++;
  13. }
  14. }
  15. }
  16. function startAgain():void
  17. {
  18. play();
  19. }





ليست هناك تعليقات:

إرسال تعليق

 
;