So, I've been avoiding posting this question because of the shear amount of prior posts. I've tried several variations of the following code, and to no avail.
I'm using FireFox (latest), Flash Player (latest), AS3, and A couple lines of JavaScript.
Here's my AS3 :
import flash.external.*;
// Handling Count For External Refreshing
var count: Number = 0;
var countMax: Number = 3;
function countHandler(): void {
if (count >= countMax) {
trace("The count has reached the max " + countMax);
ExternalInterface.call("refresh");
count = 0;
} else {
trace("The Count is " + count)
return;
}
}
I've traced the count, the total, all that, so I know that the code is working. It even resets the count when it gets to 3
Here's the javascript :
<script language="JavaScript">
function refresh() {
window.location.reload();
}
</script>
For giggles/testing, I added a button to the page to test that the above code is working...
<input type="button" value="Reload Page" onClick="refresh()">
When I press the button, it refreshes the page.
Is there something I'm missing? Why will the working AS3 Not refresh the page by triggering the working javascript?
When I click the button, it refreshes, when the code triggers via ActionScript, I'm unable to press any of the SWF buttons. So it's firing, but not actually refreshing the whole page.
Update July4th - Updated AS3 and Java - Still no Luck
refreshjs function which in reality didn't exist ( at least in your posted code ) ! So your 1st code should be :ExternalInterface.call("reload");, try that and tell us what you get.refresh()method. One Sec...<param name="allowScriptAccess" value="*" />allowscriptaccessshould bealwaysor other values but not*. For the debug, normally if you have a security ( or any other error ) you will get a message from the flash player. For more details about external interface take a look here. If you have always the problem, I will see it tomorrow because it's really late here.