Converting old Flash to Animate HTML5. Is SendAndLoad available?
We are converting the flash areas of our website to HMTL5. Our site features instructional swf movies that require user authentication. They use the LoadVars() function to call in the session status, and also track user status by sending updates from the Flash movies.
For example,
// Submit the data to check user status
. sendData.sendAndLoad("flash_session_check.asp", replyData, "POST");
If the script does not return a success, we redirect user to new url, and also do an unloadMovie -- (is this still an option?)
How should I do this with Animate CC, in javascript? Here's some more code if that's helpful.
//-------------------------------------
// USER AUTHENTICATION VIA ASP
//-------------------------------------
// Updates Activity Log (if required) and returns UserName
sendData = new LoadVars();
replyData = new LoadVars();
function sessionActivity(str) {
// -----------------------------------------
// SEND FORM DATA TO SERVER VARIABLES
// -----------------------------------------
sendData.flashActivity = str;
// -----------------------------------------
// REPLY FROM SERVER VARIABLES
// -----------------------------------------
replyData.student = "Authenticating user...";
replyData.goFlash = "";
//
// Define a callback handler
replyData.onLoad = handleReply;
// -----------------------------------------
// SEND THE FORM
// -----------------------------------------
// Submit the data and tell the user.
sendData.sendAndLoad("session-check.asp", replyData, "POST");
// -----------------------------------------
function handleReply(success) {
if (success) {
if (replyData.goFlash != 1) {
_root.statusTxtmc.statusTxt.text = "Session Not Authenticated.";
topMessage= "Sorry, your session is not authorised";
getURL("user-not-authorised.asp", "_parent");
unloadMovie(this);
}
} else {
// go to asp error page
getURL("user-not-authorised.asp", "_parent");
topMessage= "Sorry, your session is not authenticated";
unloadMovie(this);
}
}
}
Many thanks for any help offered. I don't do much programming.
Cheers.