Not signed in (Sign In)

Vanilla 1.0.3 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorsathyaksk
    • CommentTimeJan 16th 2008
     
    hi,

    my client is looking for movie thumbnails to be played when mouse pointer is on the movie and stop it when mouse pointer is moved away from the movie thumbnail similar to Flash Video Gallery - http://www.adobe.com/devnet/flash/articles/video_gallery.html.

    I am using a SWFobject to embed the flash player. and list of movie files with thumbnails are listed on the right hand side of the flash player.

    How can i implement this using SWFobject and Javascript.

    Thanks in advance,

    Satty
    • CommentAuthorphilip
    • CommentTimeJan 22nd 2008
     
    Why not build the whole thing in Flash following the Adobe example? it would be more browser-friendly and probably less complicated.

    If you must use JavaScript, you can use SWFObject to embed your video thumbnails (SWF format), then use JavaScript to start and stop the file during mouse events. something like:


    <div id="thumbnail"></div>

    <script type="text/javascript">

    var targetDiv = "thumbnail";
    var swfID = "thumbSWF";

    //SWFObject code here
    var so = new SWFObject("/swf/mythumbnail.swf", swfID, "144", "144" , "8", "#FFFFFF");
    if(so.write("thumbnail")){

    //if SWFObject successful, add mouseover and mouseout script to the same DIV

    var swf = document.getElementById(swfID);
    var thumb = document.getElementById(thumbnail);
    thumb.onmouseover = function (){
    if(swf){
    swf.Play();
    }
    }
    thumb.onmouseout = function (){
    if(swf){
    swf.Stop();
    }
    }
    }
    </script>


    i haven't tested this code (i'm sure it can be improved), but you should get the idea.

    - philip