[Proto-Scripty] Re: Need help resolving conflict between Proto and Uize frameworks

2009-06-17 Thread Alex McAuley

is it run inside a dom:loaded wrapper ?
- Original Message - 
From: piers piersplow...@gmail.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Wednesday, June 17, 2009 4:14 PM
Subject: [Proto-Scripty] Need help resolving conflict between Proto and Uize 
frameworks



 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
 [/code]

 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+'/abr/';
}
  }
 } );
 /script
 [/code]

 The only problem I'm having is that I call the function at body
 onload:

 [code]
 BODY onload=setMovie('Quicktimes/mov1.mov', 'Suzuki :
 quot;Fencequot;  1 of 12')
 [/code]

 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?

 Thanks!
 
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Need help resolving conflict between Proto and Uize frameworks

2009-06-17 Thread Rick Waldron
Maybe I'm nuts but you're calling

setMovie() in the body tag


meanwhile... you have an Ajax.Request getting some data that will call...

setMovie() when successful



So... i suspect, that onload starts playing, then the ajax request finishes
and resets your player.

I dont recommend onload='' ever btw.

should change to:

script
document.observe('dom:loaded', function () {
 call function in here

});
/script


I think even Alex would agree with me on this particular inline event ;)


Rick

On Wed, Jun 17, 2009 at 11:55 AM, Alex McAuley 
webmas...@thecarmarketplace.com wrote:


 is it run inside a dom:loaded wrapper ?
 - Original Message -
 From: piers piersplow...@gmail.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, June 17, 2009 4:14 PM
 Subject: [Proto-Scripty] Need help resolving conflict between Proto and
 Uize
 frameworks


 
  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
  [/code]
 
  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+'/abr/';
 }
   }
  } );
  /script
  [/code]
 
  The only problem I'm having is that I call the function at body
  onload:
 
  [code]
  BODY onload=setMovie('Quicktimes/mov1.mov', 'Suzuki :
  quot;Fencequot;  1 of 12')
  [/code]
 
  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?
 
  Thanks!
  
 


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---