PDA

View Full Version : ExternalInterface call IE 7 and 8


eryx
05-06-2010, 02:58 PM
I have a strange problem with an ExternalInterface call throwing me an error when it executes.

Error Message

Line:1
Char:98
Error:'null' is null or not an object
code:0


AS3 - pretty standard I am throwing a variable just so that nothing is 'null'
function getVid(e:MouseEvent):void
{
var nothing = "abc";
ExternalInterface.call("ShowVid",nothing);

}

Here is the ASP and JavaScript code

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Login" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Welcome to Cheestrings.ca</title>

<link rel="stylesheet" href="/css/style.css" type="text/css" />
<link rel="stylesheet" href="/css/nyroModal.css" type="text/css" media="screen" />
<link rel="stylesheet" href="/css/style.css" type="text/css" />
<link rel="stylesheet" href="/css/nyroModal.css" type="text/css" media="screen" />

<script type="text/javascript" src="/scripts/AC_RunActiveContent.js"></script>
<script type="text/javascript" src="/scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="/scripts/jquery.nyroModal-1.5.5.pack.js"></script>

<script type="text/javascript" src="/scripts/adobe_flash.js"></script>

<script type="text/javascript">
function RollOn(T) {
var newsrc = T.src.replace("_off", "_on");
T.src = newsrc;
}

function RollOff(T) {
var newsrc = T.src.replace("_on", "_off");
T.src = newsrc;
}

function ShowGame() {
$.nyroModalManual({url: '#UltimateRace'});

// document.getElementById('closeBut').style.visibili ty='visible'

}

function ShowVid(e) {
alert(e);

// $.nyroModalManual({url: '#videoOver'});
//document.getElementById('closeBut').style.visibili ty='hidden'
}

function removeVid() {

$.nyroModalRemove();
}

$(document).ready(function(){

$("#videoOver").flash({swf: 'swf/videoOverlay.swf', wmode: 'transparent', width: '700', height: '400'});
$("#UltimateRace").flash({swf: 'flashGames/swf/Main.swf', wmode: 'transparent', width: '742', height: '542'});

});


</script>



The UltimateRace works fine
but the one called with flash throws that strange error.

I am not an avid ASP guy so I am in uncharted territory here, any help would be great.

Thank

eryx
05-06-2010, 03:53 PM
I found that the problem was old the old style of embedding flash.

I published the it again using CS4 and swapped out the HTML

THIS SHOULD HAVE BEEN THE FIRST THING I TRIED!

from this:


<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','934','heigh t','618','src','/swf/landing','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movi e','/swf/landing', 'wmode', 'transparent' ); //end AC code
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="934" height="618">
<param name="movie" value="/swf/landing.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<embed src="/swf/landing.swf" wmode="transparent" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="934" height="618"></embed>
</object>
</noscript>

to this:


<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<script language="JavaScript" type="text/javascript">
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '930',
'height', '618',
'src', 'landing',
'quality', 'high',
'pluginspage', 'http://www.adobe.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'transparent',
'devicefont', 'false',
'id', 'landing',
'bgcolor', '#378dc1',
'name', 'landing',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'swf/landing',
'salign', ''
); //end AC code
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="930" height="618" id="landing" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="swf/landing.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#378dc1" /> <embed src="swf/landing.swf" quality="high" wmode="transparent" bgcolor="#378dc1" width="930" height="618" name="landing" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>


Thanks to the two guys that looked at it, hopefully someone in the future will find this helpful.