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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
ronan1979Commented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
FreedomITAuthor Commented:
Did not recieve a good answer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Browsers

From novice to tech pro — start learning today.