Question
How to get URL Parameters into HTML Canvas?
Here's a javascript function that reads the URL parameters and makes them usable for javascript. How can I adapt this for use inside a HMTL Canvas in Adobe Animate? I have tried unsuccessfully.
function GetURLParameter(sParam)
{
var sPageURL = window.location.search.substring(1);
var sURLVariables = sPageURL.split('&');
for (var i = 0; i < sURLVariables.length; i++)
{
var sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] == sParam)
{
return sParameterName[1];
}
}
}
// Retrieve Parameters and set Variables
var lab = GetURLParameter('lab');
var sec = GetURLParameter('sec');
Help much appreciated. I'm new to Animate, and have been searching for the solution.
Cheers,
Geoff