/    Sign up×
Community /Pin to ProfileBookmark

Urgently need help with extracting parameter

First I’ll apologize for not knowing enough about javascript in
general, let alone Prototype – I hope someone will take pity on me :p

I’m building a page that displays quicktime movies when clicking on a
horizontal scrolling thumbnail – okay, no problems with that.

I’m using a code snippet I’ve found (and hacked) to embed the
quicktimes, as follows:

[code]
<script>
function setMovie( url )
{
$(‘movieHost’).innerHTML = ”;
var elEmbed = document.createElement( ’embed’ );
elEmbed.src = url;
elEmbed.setAttribute(“width”, “100%”);
elEmbed.setAttribute(“height”,”100%”);
elEmbed.setAttribute(“scale”,”aspect”);
elEmbed.setAttribute(“bgcolor”,”black”);

$(‘movieHost’).appendChild( elEmbed );
}

new Ajax.Request( ‘Quicktimes/movies.xml’, {
method: ‘get’,
onSuccess: function( transport ) {
var movieTags = transport.responseXML.getElementsByTagName
( ‘movie’ );

$(‘movieList’).innerHTML = ”;

var bFirst = true;
for( var b = 0; b < movieTags.length; b++ ) {
var url = movieTags[b].getAttribute(‘xxx’);
var title = movieTags[b].getAttribute(‘title’);
if ( bFirst )
{
setMovie( url );
bFirst = false;
}
var html = ‘<a href=”javascript:void setMovie(”+url+”);”>’;
html += title+'</a><br/>’;
$(‘movieList’).innerHTML += html;
}
}
} );
</script>
[/code]

But instead of extracting from the ‘movies.xml’ file I’m invoking
setMovie via:

[code]
<a href=”#” class=”thumbnail” onClick=”setMovie(‘Quicktimes/
mov1.mov’)” onmouseover=”MM_effectAppearFade(‘thumb1’, 0, 0, 100,
false)” onmouseout=”MM_effectAppearFade(‘thumb1’, 0, 100, 0,
false)”><img src=”thumbs/mov1.gif” alt=””/></a>
[/code]

(When the user clicks on a thumbnail).

So I’m guessing that the xml file is no longer a factor.

What I’m looking to do is extract the ‘title’ attribute from the
current playing quicktime movie and display it in a div on the
page….

But I’m not sure how to wrangle the js to do that… and not sure
where (or how) to add the ‘title’ parameter.

Any help with this would be much appreciated – thanks!

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @piers2009 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.28,
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,
)...