You have a ready
block but the element is not in the body yet, so getElementById
likely returns null,
Try:
$(document).ready(function () {
var flashObj = document.getElementById("flashGame");
flashObj.AdLoaded();
});
Note, that document.ready is not an indication that the flash finished loading, just that the DOM is ready, so you might have to even do:
$(window).on("load",function () {
var flashObj = document.getElementById("flashGame");
flashObj.AdLoaded();
});