Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » Flash - ActionScript

Can't get External API to work in IE7

 
Jump to:  
 
atpark333
PostPosted: Thu May 22, 2008 2:28 pm    Post subject: Can't get External API to work in IE7
       
I'm trying to get a Flash Ad to call a Javascript function in an Ajax page. I'm
using ActionScript 2.0 ExternalAPI to call a function in the page that adds an
item to a shopping list. I can get this to work in all browsers except IE7. It
even works in IE7 when I put this Ad alone in a basic html page, but as soon as
I put it in an Ajax page it does not call the function in IE7.
I appreciate any help or suggestions
 

 
kglad
PostPosted: Thu May 22, 2008 3:01 pm    Post subject: Re: Can't get External API to work in IE7
       
i haven't had any problems using externalinterface with ajax. in particular, everything works in ie7.
 

 
atpark333
PostPosted: Thu May 22, 2008 8:56 pm    Post subject: Re: Can't get External API to work in IE7
       
Thanks for the input. I'm not familiar with Ajax so it helps to know if there
are any known issues. I assumed it was an Ajax issue because the same ad works
in a non-ajax web page that uses frames. The ad is being served through
DoubleClick, here is the rich media code that embeds the Flash Ad:

<!-- This is DART's Rich Media code template. It basically checks user's flash
version and browser, embeds flash creative in page or serves fall back image if
user does not have the required version of flash player. -->

<SCRIPT LANGUAGE=JavaScript>
<!--
var dcswf = "%h/1146572/HormelFlash.swf";
var dcgif = "%h/1146572/HormelFallBack.jpg";
var advurl = "%c%u";
var dcadvurl = escape(advurl);
var dcminversion = 8;
var dcmaxversion = 9;
var plugin = false;
var dccreativewidth = "300";
var dccreativeheight = "250";
var dcwmode = "transparent";
var dcbgcolor = "FFFFFF";
var dcallowscriptaccess = "always";

if (((navigator.appName == "Netscape") &&
(navigator.userAgent.indexOf("Mozilla") != -1) &&
(parseFloat(navigator.appVersion) >= 4) && (navigator.javaEnabled()) &&
navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] &&
navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)) {
var plugname=navigator.plugins['Shockwave Flash'].description;var
plugsub=plugname.substring(plugname.indexOf("."),-1); var
plugsubstr=plugsub.substr(-1)
if( plugsubstr >= dcminversion) { plugin = true;}
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 &&
(navigator.userAgent.indexOf("Opera")<0) &&
(navigator.userAgent.indexOf("Windows 95")>=0 ||
navigator.userAgent.indexOf("Windows 98")>=0 ||
navigator.userAgent.indexOf("Windows NT")>=0) && document.all)
{
document.write('<script language=VBScript>' + '\n' +
'dcmaxversion = '+dcmaxversion + '\n' +
'dcminversion = '+dcminversion + '\n' +
'Do' + '\n' +
'On Error Resume Next' + '\n' +
'plugin = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.\" &
dcmaxversion & \"\")))' + '\n' +
'If plugin = true Then Exit Do' + '\n' +
'dcmaxversion = dcmaxversion - 1' + '\n' +
'Loop While dcmaxversion >= dcminversion' + '\n' +
'<\/script>');
}
if ( plugin ) {
adcode = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+
' ID="FLASH_ID" WIDTH="'+ dccreativewidth +'" HEIGHT="'+ dccreativeheight
+'">'+
'<PARAM NAME=movie VALUE="' + dcswf + '?clickTag='+ dcadvurl +'"><PARAM
NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#'+ dcbgcolor +'><PARAM
NAME=wmode VALUE='+ dcwmode +'><PARAM NAME="AllowScriptAccess"
VALUE="'+dcallowscriptaccess+'">'+
'<EMBED src="' + dcswf + '?clickTag='+ dcadvurl +'" quality=high
wmode='+dcwmode+
' swLiveConnect=TRUE WIDTH="'+ dccreativewidth +'" HEIGHT="'+
dccreativeheight +'" bgcolor=#'+ dcbgcolor+
' TYPE="application/x-shockwave-flash"
AllowScriptAccess="'+dcallowscriptaccess+'"></EMBED></OBJECT>';
if(('%eenv!'!="j")&&(typeof
dclkFlashWrite!="undefined")){dclkFlashWrite(adcode);}else{document.write(adcode
);}
} else {
document.write('<A TARGET="%t" HREF="%c%u"><IMG SRC="' + dcgif + '" alt=""
BORDER=0></A>');
}
//-->
</SCRIPT><NOSCRIPT><A TARGET="%t" HREF="%c%u"><IMG
SRC="%h/1146572/HormelFallBack.jpg" alt="" BORDER=0></A></NOSCRIPT>

the ad can be viewed here:
LINK
 

 
kglad
PostPosted: Fri May 23, 2008 12:58 am    Post subject: Re: Can't get External API to work in IE7
       
you should check if there's a known issue with that code and ie7.
 

 
atpark333
PostPosted: Tue May 27, 2008 4:32 pm    Post subject: Re: Can't get External API to work in IE7
       
I think I found the problem the Flash ad is within a <form> element. The ID
attribute of the <OBJECT> element was throwing an error (undefined object) in
IE7.

I found this work around:

LINK
 

 
kglad
PostPosted: Wed May 28, 2008 6:28 am    Post subject: Re: Can't get External API to work in IE7
       
great.
 

 
atpark333
PostPosted: Wed May 28, 2008 4:55 pm    Post subject: Re: Can't get External API to work in IE7
       
Unfortunately this did not solve the issue. There isn't a JavaScript error
anymore but the flash Ad does not call the JS function when clicked. I added
this code after the <OBJECT><EMBED> elements:

<script type="text/javascript">window.FLASH_AD =
document.forms[0].FLASH_AD;</script>

It still works fine in FireFox, Safari, and IE6.
 

 
kglad
PostPosted: Wed May 28, 2008 8:41 pm    Post subject: Re: Can't get External API to work in IE7
       
a swf embedded within a form element causes a known issue with ie and externalinterface. use google to search for work-arounds.
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

Wyclef Jean music Fotka ksztaƂtki segmentowe Kwiaty mobing