I think there was a problem with your JavaScript code. I took the liberty of uploading a zip file, which has mainpage.html redirecting to secondpage.html and grabbing the Flash variable from the URL's window.location.search.
I also changed the name from myvar to myCountry, which is also the name of the dynamic text variable in page2.swf. One thing to note is that the Flash code utilizes the AC_RunActiveContent.js, so it won't run without that file.
I commented what I did in secondpage.html's JavaScript code, which you can also view below. Good luck, and let me know if you have any other questions!
Take care,
Mark
Code:
<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
// Grab the string in the window.location and place it into a JavaScript variable called "argstring."
var argstring = window.location.search;
if (argstring == "")
{
// If the argstring is empty (myCountry=), then fill the variable with a default country.
argstring = "myCountry=China";
} else {
// If the argstring is not empty, then remove the "?" and grab the value of myCountry.
var argstring=argstring.replace(/\?/,"");
}
// You can uncomment the following line to test whether the variable was captured to the page correctly.
//alert(argstring);
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '550',
'height', '400',
'src', 'page2',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
// Add the FlashVars variable and the Javascript string.
'FlashVars', argstring,
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'page2',
'bgcolor', '#ffffff',
'name', 'page2',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'page2',
'salign', ''
); //end AC code
}
</script>
Last edited by MyFriendIsATaco; 04-29-2009 at 08:02 PM.
Reason: Please wrap code blocks in [CODE] tags. :)