I have an app where I take a snapshot of the screen.
The snapshot code is working fine, but I'm not sure when screen rendering is complete, so that I can trigger the snapshot to be taken.
i.e I have a complex scene with multiple objects, with sub objects.
The scene builder, adds all the objects (image etc), and as soon as this code completes, I trigger an event. The event handler code, then takes a snapshot.
However if I take the snapshot straight away. The snapshot is blank.
But if I wait 2 frames, the snapshot works.
Is waiting a couple of frames a reliable way to do this, or should I really be using something else i.e some other event?
Edit.
Since first posting, I've tried using the ADDED_TO_STAGE event, but this doesn't seem to fix it. i.e I can't take a snapshot straight after that event has been recieved
Perhaps I should wait for that event, then wait another few frames??