/    Sign up×
Community /Pin to ProfileBookmark

Accessing <Object> or <EMBED> tag using javascript or vbscript

I am creating an ad serving application using Flash and DHTML and I need to figure out the x and y coordinates of a flash movie that does not have a ‘id’ or ‘name’ attribute defined in the <OBJECT> or <EMBED> tags. The application is to be placed on third party web sites so I do not have access to modify the flash movies on these web sites.

I only need to make it work in Internet Explorer on the PC. The solution I came up with in JavaScript is to access the <EMBED> using document.embeds[0] and then assign the movie an id using document.embeds[0].id = “whatevername”. Only problem is that with
flash the <EMBED> tags are nested in the <OBJECT> tags and this seems to prevent the browser from being able to see the <EMBED> tags so the document.embeds[0] does not work. document.plugins[0] does not work either. I also do not know of a way to access the <OBJECT> tags using
a built in array like you can with the <EMBED> tags. Does anyone know of a solution to this problem? Perhaps there is an equivalent statement to document.embeds[0] in client side VBScript that would work? It would work to be able to set the id in either the <OBJECT> or <EMBED> tags or get the x and y coordinates some other way (which I don’t think is possible).

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@fidoauthorNov 23.2002 — Thank you Dave.
Copy linkTweet thisAlerts:
@sandboxJan 29.2009 — I am creating an ad serving application using Flash and DHTML and I need to figure out the x and y coordinates of a flash movie that does not have a 'id' or ‘name’ attribute defined in the <OBJECT> or <EMBED> tags. The application is to be placed on third party web sites so I do not have access to modify the flash movies on these web sites.

I only need to make it work in Internet Explorer on the PC. The solution I came up with in JavaScript is to access the <EMBED> using document.embeds[0] and then assign the movie an id using document.embeds[0].id = “whatevername”. Only problem is that with

flash the <EMBED> tags are nested in the <OBJECT> tags and this seems to prevent the browser from being able to see the <EMBED> tags so the document.embeds[0] does not work. document.plugins[0] does not work either. I also do not know of a way to access the <OBJECT> tags using

a built in array like you can with the <EMBED> tags. Does anyone know of a solution to this problem? Perhaps there is an equivalent statement to document.embeds[0] in client side VBScript that would work? It would work to be able to set the id in either the <OBJECT> or <EMBED> tags or get the x and y coordinates some other way (which I don’t think is possible).
×

Success!

Help @fido spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...