프리 로더는 기본적으로 스프라이트입니다. 모든 flex 구성 요소는 스프라이트를 확장하므로 실제로 스프라이트를 계속 쉽게 사용할 수 있습니다. 그게 예고제 스프라이트를 제거하는 응용 프로그램 프레임 워크의 부분을 재정의하는 것이 얼마나 어려울 지 모르겠습니다. 그러나 스프라이트를 스테이지에 다시 추가 할 수 있다고 생각합니다 ... 사용자 정의 구성 요소를 사용합니다.
상태와 함께 사용할 수 있도록 UIComponent를 만들어 프리 로더 구성 요소를 추가해야 할 것입니다. 그런 다음 NEW UIComponent를 기본 상태로 설정하십시오.
다음은 내 머리 꼭대기에서 나오는 "psuedo"코드입니다. 앱에서 다음
public class MyFlexPreLoader extends UIComponent{
private var var preloader:YourBasePreLoader; //This is the preloader you're already using
override protected function createChildren(){
//Add the Preloader here!
preloader = new YourBasePreLoader();
addChild(preloader);
}
//Also add event listeners to manipulate your preloader to show the progress of loading stuff from DB
}
<comp:MyFlexPreLoader includeIn="preloading"/>
이제 사전로드에서 멀리 응용 프로그램의 currentState를 변경 할 때. 제대로 작동하려면 UIComponent에서 몇 가지 메서드를 재정의해야 할 수 있습니다.