Javascript Function is undefined in firefox but works in IE

Hey all,
I have searched and tried to fix this no idea. it keeps saying my funtion is undefined in firefox here is the function:

Code:
<script type="text/javascript">

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);
  }       
}
</script>



and here is how it is called:


Code:
<script type="text/javascript">
var currentMovieID = null;
var previousMovieID = null;
var currentActivePlayer = null;
var previousActivePlayer = null;


function formSend(str,title,movieID,activeDiv)
{  



   if (currentMovieID) {
        previousMovieID = currentMovieID;      
    }
   if (currentActivePlayer) {
        previousActivePlayer = currentActivePlayer;      
    }
    currentActivePlayer = activeDiv;
    currentMovieID = movieID;
   

   
    if (previousActivePlayer) {
    alert(previousActivePlayer);
getFlashMovieObject(previousMovieID).stopVideo();
     
      document.getElementById(previousActivePlayer).style.display="none";
     
    }
    document.getElementById(currentActivePlayer).style.display="block";
   
    window.setTimeout("getFlashMovieObject('"+movieID+"').sendTextToFlash('"+str+"','"+title+"')",1000);
}  
</script>
<script type="text/javascript">

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);
  } 	
}
</script>

Open in new window

FreedomITAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ronan1979Connect With a Mentor Commented:
1) your source file refer to LOCALHOST.
    Sorry, we are not able to access it.

    found a link with google, but even there, i could find a player ...

2) what 'getFlashMovieObject' return under FF ? check for null value

3) is 'getFlashMovieObject' called after page is totally loaded ?
0
 
remorinaCommented:
The function seems to be working fine, are you passing the flash ID and div ID to the function call ?
Also make sure the actionscript function sendTextToFlash is present

If the error you're getting is getFlashMovieObject("flashID").sendTextToFlash is not a function this means the problem lies in your actionscript

You can get more info and a working example about this method here
http://www.flashwonderland.com/html-interact-02-send-text-to-flash/send-text-field-to-flash.html


0
 
FreedomITAuthor Commented:
nope I know it is all there cause it works great in IE but when I do it in firefox it errors the error I get is that
Error: getFlashMovieObject("FaqPlayer0") is undefined
Source File: http://localhost:1292/DirectVaLoans.Web/VA_Loan_Questions/Default.aspx
Line: 291
0
 
FreedomITAuthor Commented:
Did not recieve a good answer
0
All Courses

From novice to tech pro — start learning today.