Returning an embed movie object
I have an object-embed combination for a flash swf file. I have added javascript controls for the movie.
I am successfully using the following in a function to access the movie and send the javascript commands:
- 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);
- }
I am trying to use jQuery to select the objects by determining if one of the flash properties exists. Something like:
- if ($("#"+movieName).TGetProperty("/",15) != "undefined") {
- return $("#"+movieName).get(0);
- } else if ($("#"+movieName).children("embed:first").TGetProperty("/",15) != "undefined") {
- $("#"+movieName).children("embed:first").get(0);
- }
$("#"+movieName) works for IE, but nothing I have tried can get the correct movie element out of the DOM to be the equivalent of document.embeds[movieName]. I have tried quite a few combinations beyond what is in the code above like:
- $("#"+movieName).children("embed:first")
- $("#"+movieName+"embed:first")
- $("[name='"+movieName+"']")
Any idea what the correct method is would be greatly appreciated. I have it working but the problem bugs me.
Steven