I want to count (via google analytics) the times a pop-up is displayed to the user. Which event should I use to deduce that the pop-up is being displayed to the user?
If a new pop up is created every time you display one, it doesn't matter which one you use as both events will be fired upon creating. If you are reusing the same object, you should use addedToStage
as creationComplete
is dispatched only once per UIComponent
.
creationComplete
is dispatched when the component, and all of its child components, and all of their children, and so on have been created, laid out, and are visible. addedToStage
is dispatched when a display object is added to the on stage display list, either directly or through the addition of a sub tree in which the display object is contained.So if you are reusing the same object, you will get an addedToStage
every time you display it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With