2017-02-02 2 views
0

주 시간이 끝나면 "시간이 다되었습니다"무비 클립을 표시하고 싶습니다. 그런 다음 3 초 카운트 다운이 끝나면 특정 프레임으로갑니다. remove 이벤트 리스너를 사용하지만 모든 리스너와 코드를 작성합니다. 이 모든 게 쉬운 일이야? 스테이지를 중지하는 쉬운 방법이 있습니까?

import flash.net.SharedObject; 
import flash.utils.Timer; 
import flash.events.TimerEvent; 
import flash.events.TouchEvent; 
import flash.ui.Multitouch; 
import Turn; 
import ScoreHolder; 
  
timeisup.visible = false ; 
  
//This timer start when the main timer stop. 
var threesecond:Timer = new Timer(3000,0); 
  
////MAIN TIMER 
var minute:Number = 0; 
var second:Number = 15; 
  
//This timer check to timer and set to what happen if time over. 
var timercheck:Timer = new Timer(1000,0); 
timercheck.addEventListener(TimerEvent.TIMER, timercheck1); 
timercheck.start(); 
  
function timercheck1(evt:TimerEvent):void { 
if (minute <1 && second <1) 
{ 
timer.stop(); 
timeisup.visible = true; 
timeisup.play(); 
threesecond.start(); 
  
stage.removeEventListener(Event.ENTER_FRAME, h1); 
stage.removeEventListener(Event.ENTER_FRAME, h2); 
stage.removeEventListener(Event.ENTER_FRAME, h3); 
stage.removeEventListener(Event.ENTER_FRAME, h4); 
stage.removeEventListener(Event.ENTER_FRAME, h5); 

    } 
} 
  
////What gonna happen to when threesecond over 
threesecond.addEventListener(TimerEvent.TIMER, zamanbittia); 
  
function zamanbittia(evt:TimerEvent):void 
{ 
gotoAndPlay(392);  
} 
  
// Create the timer 
// Checks the clock function every 1000 milisecond (1 second) 
  
var timer:Timer = new Timer(1000); 
timer.addEventListener(TimerEvent.TIMER, clock); 
timer.start(); 
  
// Function that increments the timer 
function clock(evt:TimerEvent):void {  
// every time this function is checked increment second by one 
second -= 1; 
// If the second is 59 
if(second < 0){ 
// The minute will be plussed with 1 
minute -= 1; 
//and the zero will be set to 00 
second = 59; 
} 

또한 나는
stage.frameRate = 0.01; 

을 시도하지만 내가 오류 개체로 이동하는 동안 타이머가 정지하면 그것은 천천히 그리고.

+0

정확히 무엇을하고 싶은지 분명하지 않습니다. 만약 당신이 모든 중첩 된 무비 클립을 멈추고 싶다면 다음과 같이하면됩니다 :'stage.stopAllMovieClips();' – BadFeelingAboutThis

+0

스테이지에서 무작위로 움직이는 버튼들. 멈추려 고 시도하고 있습니다. 작동하지 않습니다. – KucuKeko

+0

버튼을 움직이는 방법이 명확하지 않은데, 버튼이 표시되어있는 내용과 코드의 상당 부분 (예 : 모든 ENTER_FRAME이 이벤트 리스너를 제거함) – BadFeelingAboutThis

답변

관련 문제