javascript - Elegant way to get ExternalInterface working with all browsers -


i want call function inside flash movie javascript, using externalinterface class. problem work firefox need use embed element , rest have object element. solve it, gave different ids 2 elements , depending on user agent select 1 or other:

 function getmovie(moviename) {      alert(navigator.useragent);      if (navigator.useragent.indexof("firefox") != -1) {          return document["flash_embed"];      } else {          return document["flash_object"];      }  } 

this works, not elegant , may not work other browsers... know better way this?

use swfobject embed flash movie, , use retrieve correct id.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -