이름 충돌을 피하기 위해 SWF를 자체 응용 프로그램 도메인 (자식이 아님)에로드하려고합니다. 그것은 정의를 덮어 쓰지 않습니다으로,
var swfLoader:Loader = new Loader();
var loaderContext:LoaderContext = new LoaderContext();
// child SWF adds its unique definitions to
// parent SWF; both SWFs share the same domain
// child SWFs definitions do not overwrite parents
loaderContext.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
// child SWF uses parent domain definitions
// if defined there, otherwise its own
loaderContext.applicationDomain = ApplicationDomain.currentDomain;
// child SWF domain is completely separate and
// each SWF uses its own definitions
loaderContext.applicationDomain = new ApplicationDomain();
// Load the swf file
swfLoader.load(new URLRequest("file.swf"), loaderContext);
내가 첫 번째 방법을 사용하는 것이 좋습니다 것
:
는 응용 프로그램 도메인의 세 가지 유형이 있습니다.
두 개의 다른 응용 프로그램을 사용해 볼 수 있습니까? 그런 식으로 우리는 당신의 싱글 톤이 비난받을 것인지 아닌지 확신 할 수 있습니다. – dirkgently
두 응용 프로그램이 하위 응용 프로그램 도메인에로드되면 단일 개체가 충돌하지 않습니다. 충돌하는 응용 프로그램 도메인에로드되는 경우에만 해당됩니다. 버그를 찾기 위해 더 자세히 조사하겠습니다. – marketer