Add AJAX Connection to flash functions