2011-08-27 5 views
0

나는 앱에 두 개의 sharedProperties을 가지고 있습니다. 그 중 하나는 batonProperty입니다. 그 중 하나만 동기화하려는 경우 쉽습니다. sync 이벤트에 eventlistener를 추가하기 만하면됩니다. 두 개가있는 경우 이벤트 청취자를 둘 다에 연결하여 각 동기화시기를 확인할 수는 있지만 둘 다 동기화 될 때까지 기다리는 방법은 무엇입니까?Adobe LCCS : 두 개의 sharedProperties가 동기화 될 때까지 기다리는 방법?

테스트 할 수있는 모든 코드 샘플을 매우 환영합니다.

답변

1

나는 sharedProperties로 작업하지는 않았지만 둘 이상의 이벤트가 발생할 때 어떤 순서로 기다릴 필요가있는 상황에서는이 행의 어떤 부분에서 뭔가를 사용할 수 있습니다 기본 설정 :

var event1occurred:Boolean; 
var event2occurred:Boolean; 

function onEvent1(e:Event):void { 
    event1occurred = true; 
    checkIfAllEventsOccurred(); 
} 

function onEvent2(e:Event):void { 
    event2occurred = true; 
    checkIfAllEventsOccurred(); 
} 

function checkIfAllEventsOccurred():void { 
    if(event1occurred && event2occurred) { 
     // Do stuff here 
    } 
} 
관련 문제