franko75 0 Newbie Poster

I'm using jQuery Cycle plugin for a slideshow of images and also potentially swf files. I've written a script to pull images and movies out of the page content (which is part of a CMS - so i never know what image/swf content will be there, the slideshow has to be constructed dynamically). I think I'm almost there, but there seems to be a conflict with the controls on my swf and the controls i'm using for the slideshow - basically i can't get the swf file to play. If I disable javascript, the swf controls work fine, so there must be a conflict caused by the javascript i've written.

Can anyone see a problem which might be causing this? An example of the problem is here (best checked in Firefox at the moment) - http://maguiresonline.co.uk/index2.php/projects/client/hbm_sayers/view/37
My script is as follows:

$(function() {
   
        //need to prepend divs in this order for correct layout
        $('.project_view').prepend('<div id="slideshow"></div>');
   
        $('#slideshow').prepend('<div id="slides"></div>');
    $('#slideshow').prepend($('#controls').hide());
   
       //pick up images + flash movies - even if there is only one to show, place it in slide container anyway (without JS enabled, images will rack at bottom)
       $('.project_view img, .project_view embed').each(function (i) {   
             $('#slides').append(this);
         $(this).addClass('slide');
             $(this).hide();
    });
 
     //show the first item
     $('.slide:first').show();
           
    //check there is more than one image before activating slideshow and controls   
    if ($('.slide').length > 1)
    {
            $('#pause').click(function() { $('#slides').cycle('pause'); return false; });
            $('#play').click(function() { $('#slides').cycle('resume'); return false; });
   
            $('#slideshow').hover(
                function() { $('#controls').fadeIn(); },
                function() { $('#controls').fadeOut(); }
            );
   
            $('#slides').cycle({
                fx:     'fade',
                speed:   800,
                timeout: 8000,
                next:   '#next',
                prev:   '#prev'
            });
       
       
    }
});