The update won't happen until the next frame has been constructed. You're taking a screenshot of one frame and the changes you made won't be active until the next frame.
rectColor.color=0x000000;
trace("color set");
this.addEventListener( Event.FRAME_CONSTRUCTED, frameConstructedHandler );
private function frameConstructedHandler( e:Event ):void {
this.removeEventListener( Event.FRAME_CONSTRUCTED, frameConstructedHandler );
takeScreenShot();
}
private function takeScreenShot():void{
trace("screenshot taken");
//stuff
}
That will delay the screenshot until the following frame has finished construction. That may or may not be too soon (I can't remember the order of GUI events and I don't have time to look it up). If that doesn't work. swap FRAME_CONSTRUCTED
with ENTER_FRAME
and it should work. Regardless of which event needs to be used, that is your problem here