spazcer
February 18th, 2008, 02:26 PM
So I'm using the External API in flash to call a function in flash every time a javascript event occurs. The flash side is working fine but the javascript side works in every browser except certain version of IE. Here's the javascript code:
function getFlashMovieObject(movieName)
{
if (window.document[movieName])
{
return window.document[movieName];
}
if (navigator.appName.indexOf("Microsoft Internet")==-1)
{
if (document.embeds && document.embeds[movieName])
return document.embeds[movieName];
}
else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
{
return document.getElementById(movieName);
}
}
function changelNamenow() {
var fPlane=getFlashMovieObject("plane");
fPlane.changelName(document.getElementById("LastN").value);
}
function changefNamenow() {
var fPlane=getFlashMovieObject("plane");
fPlane.changefName(document.getElementById("FirstN").value);
}
function changecompanynow() {
//alert(document.getElementById("Company").value);
getFlashMovieObject("plane").changecompany(document.getElementById("Company").value);
}To see the final effect go to http://power.magicomm.biz and type your name into the First Name and Last Name fields. The javascript uses onBlur() to call a function in flash that loads the contents of the input box and displays them on the newspaper accordingly.
So this is really bugging me that i cant get this to work in IE so any help would be greatly apreciated.
function getFlashMovieObject(movieName)
{
if (window.document[movieName])
{
return window.document[movieName];
}
if (navigator.appName.indexOf("Microsoft Internet")==-1)
{
if (document.embeds && document.embeds[movieName])
return document.embeds[movieName];
}
else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
{
return document.getElementById(movieName);
}
}
function changelNamenow() {
var fPlane=getFlashMovieObject("plane");
fPlane.changelName(document.getElementById("LastN").value);
}
function changefNamenow() {
var fPlane=getFlashMovieObject("plane");
fPlane.changefName(document.getElementById("FirstN").value);
}
function changecompanynow() {
//alert(document.getElementById("Company").value);
getFlashMovieObject("plane").changecompany(document.getElementById("Company").value);
}To see the final effect go to http://power.magicomm.biz and type your name into the First Name and Last Name fields. The javascript uses onBlur() to call a function in flash that loads the contents of the input box and displays them on the newspaper accordingly.
So this is really bugging me that i cant get this to work in IE so any help would be greatly apreciated.