I\'m trying to detect when pop ups are visible (including tool tips if possible). The reason is that I need to hide or freeze (capture a snapshot) the Stage* components (StageWe
For my Spark
Application
I had to make a few other modifications to RIAStar's answer. My custom class was not found in the preloader.initialize()
yet ( ApplicationDomain.currentDomain.getDefinition()
) so I added an event listener for the PRELOADER_DOC_FRAME_READY
event.
package com.mydomain.preloaders {
import flash.display.Sprite;
import flash.events.Event;
import flash.system.ApplicationDomain;
import flash.utils.getDefinitionByName;
import mx.core.Singleton;
import mx.events.FlexEvent;
import mx.preloaders.SparkDownloadProgressBar;
public class RegisteringPreloader extends SparkDownloadProgressBar {
public function RegisteringPreloader() {
}
public var preloaderSprite:Sprite;
override public function set preloader(value:Sprite):void {
super.preloader = value;
preloaderSprite = value;
value.addEventListener(FlexEvent.PRELOADER_DOC_FRAME_READY, preloaderCompleteHandler);
}
protected function preloaderCompleteHandler(event:Event):void {
var myCustomClass:Class;
var classPath:String;
var hasDefinition:Boolean;
preloaderSprite.addEventListener(FlexEvent.PRELOADER_DOC_FRAME_READY, preloaderCompleteHandler);
classPath = "com.domain.managers::MyClassImpl";
hasDefinition = ApplicationDomain.currentDomain.hasDefinition(classPath);
if (hasDefinition) {
myCustomClass = Class(getDefinitionByName(classPath));
Singleton.registerClass("mx.managers::ISingletonClass", myCustomClass);
}
}
}
}
The rest of the steps are the same as RIAStar's.