I know it's probably a lousy idea but I have both prototype and uize referenced in the <head> of my document:
Code:
<script type="text/javascript" src="js/Uize.js"></script>
<script type="text/javascript" src="javascript/prototype.js"></script>
The only time I use a prototype function in the <body> of the document is to create a function that plays a movie when a thumbnail is clicked.
The function is:
Code:
<script>
function setMovie( url, title )
{
$('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 );
$('nowPlaying').innerHTML = title;
}
new Ajax.Request( '', {
method: 'get',
onSuccess: function( transport ) {
var bFirst = true;
for( var b = 0; b < movieTags.length; b++ ) {
if ( bFirst )
{
setMovie( url, title );
bFirst = false;
}
var html = '<a href="javascript:void setMovie(\''+url+'\',\''+title+'\');">';
html += title+'</a><br/>';
}
}
} );
</script>
The only problem I'm having is that I call the function at body onload:
Code:
<BODY onload="setMovie('Quicktimes/mov1.mov', 'Suzuki : "Fence" 1 of 12')">
In order that the first movie starts playing right away...
And everything is fine... EXCEPT that about 10 or 15 seconds into the first movie it skips back to the beginning and starts playing again. Once it's done that everything works fine until a page reload - and then it plays and skips back.
I've tried changing the order of the script references in the <head> section... but that breaks the uize framework.
Is there some way to recode the function with absolutes?... or some other way to resolve this?
Thanks!
|