Modified for flash functionality.