JavaScript - Javascript Lightbox Won't Block Out Flash Component
Basically i have made a small gallery with a lightbox feature, and it half works. What i am trying to do is make the lightbox fade out the flash navigation like the rest of the page but it just seems to overlap my lightbox. Any ideas?
Here is the link for the webpage: http://www.frozen-shy.webs.com/arts_signatures.html Here is the javascript code: Code: /* Table of Contents ----------------- Configuration Functions - getPageScroll() - getPageSize() - pause() - getKey() - listenKey() - showLightbox() - hideLightbox() - initLightbox() - addLoadEvent() Function Calls - addLoadEvent(initLightbox) */ // // Configuration // // If you would like to use a custom loading image or close button reference them in the next two lines. var loadingImage = 'loading.gif'; var closeButton = 'close.gif'; // // getPageScroll() // Returns array with x,y page scroll values. // Core code from - quirksmode.org // function getPageScroll(){ var yScroll; if (self.pageYOffset) { yScroll = self.pageYOffset; } else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict yScroll = document.documentElement.scrollTop; } else if (document.body) {// all other Explorers yScroll = document.body.scrollTop; } arrayPageScroll = new Array('',yScroll) return arrayPageScroll; } // // getPageSize() // Returns array with page width, height and window width, height // function getPageSize(){ var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = document.body.scrollWidth; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } var windowWidth, windowHeight; if (self.innerHeight) { // all except Explorer windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { // other Explorers windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } // for small pages with total height less then height of the viewport if(yScroll < windowHeight){ pageHeight = windowHeight; } else { pageHeight = yScroll; } // for small pages with total width less then width of the viewport if(xScroll < windowWidth){ pageWidth = windowWidth; } else { pageWidth = xScroll; } arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) return arrayPageSize; } // // pause(numberMillis) // Pauses code execution for specified time. Uses busy code, not good. // Code from http://www.faqts.com/knowledge_base/view.phtml/aid/1602 // function pause(numberMillis) { var now = new Date(); var exitTime = now.getTime() + numberMillis; while (true) { now = new Date(); if (now.getTime() > exitTime) return; } } // // getKey(key) // Gets keycode. If 'x' is pressed then it hides the lightbox. // function getKey(e){ if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } key = String.fromCharCode(keycode).toLowerCase(); if(key == 'x'){ hideLightbox(); } } // // listenKey() // function listenKey () { document.onkeypress = getKey; } // // showLightbox() // Preloads images. Places new image in lightbox then centers and displays. // function showLightbox(objLink) { // prep objects var objOverlay = document.getElementById('overlay'); var objLightbox = document.getElementById('lightbox'); var objCaption = document.getElementById('lightboxCaption'); var objImage = document.getElementById('lightboxImage'); var objLoadingImage = document.getElementById('loadingImage'); var objLightboxDetails = document.getElementById('lightboxDetails'); var arrayPageSize = getPageSize(); var arrayPageScroll = getPageScroll(); // center loadingImage if it exists if (objLoadingImage) { objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - objLoadingImage.height) / 2) + 'px'); objLoadingImage.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px'); objLoadingImage.style.display = 'block'; } // set height of Overlay to take up whole page and show objOverlay.style.height = (arrayPageSize[1] + 'px'); objOverlay.style.display = 'block'; // preload image imgPreload = new Image(); imgPreload.onload=function(){ objImage.src = objLink.href; // center lightbox and make sure that the top and left values are not negative // and the image placed outside the viewport var lightboxTop = arrayPageScroll[1] + ((arrayPageSize[3] - 35 - imgPreload.height) / 2); var lightboxLeft = ((arrayPageSize[0] - 20 - imgPreload.width) / 2); objLightbox.style.top = (lightboxTop < 0) ? "0px" : lightboxTop + "px"; objLightbox.style.left = (lightboxLeft < 0) ? "0px" : lightboxLeft + "px"; objLightboxDetails.style.width = imgPreload.width + 'px'; if(objLink.getAttribute('title')){ objCaption.style.display = 'block'; //objCaption.style.width = imgPreload.width + 'px'; objCaption.innerHTML = objLink.getAttribute('title'); } else { objCaption.style.display = 'none'; } // A small pause between the image loading and displaying is required with IE, // this prevents the previous image displaying for a short burst causing flicker. if (navigator.appVersion.indexOf("MSIE")!=-1){ pause(250); } if (objLoadingImage) { objLoadingImage.style.display = 'none'; } objLightbox.style.display = 'block'; // After image is loaded, update the overlay height as the new image might have // increased the overall page height. arrayPageSize = getPageSize(); objOverlay.style.height = (arrayPageSize[1] + 'px'); // Check for 'x' keypress listenKey(); return false; } imgPreload.src = objLink.href; } // // hideLightbox() // function hideLightbox() { // get objects objOverlay = document.getElementById('overlay'); objLightbox = document.getElementById('lightbox'); // hide lightbox and overlay objOverlay.style.display = 'none'; objLightbox.style.display = 'none'; // disable keypress listener document.onkeypress = ''; } // // initLightbox() // Function runs on window load, going through link tags looking for rel="lightbox". // These links receive onclick events that enable the lightbox display for their targets. // The function also inserts html markup at the top of the page which will be used as a // container for the overlay pattern and the inline image. // function initLightbox() { if (!document.getElementsByTagName){ return; } var anchors = document.getElementsByTagName("a"); // loop through all anchor tags for (var i=0; i<anchors.length; i++){ var anchor = anchors[i]; if (anchor.getAttribute("href") && (anchor.getAttribute("rel") == "lightbox")){ anchor.onclick = function () {showLightbox(this); return false;} } } // the rest of this code inserts html at the top of the page that looks like this: // // <div id="overlay"> // <a href="#" onclick="hideLightbox(); return false;"><img id="loadingImage"></a> // </div> // <div id="lightbox"> // <a href="#" onclick="hideLightbox(); return false;" title="Click anywhere to close image"> // <img id="closeButton"> // <img id="lightboxImage"> // </a> // <div id="lightboxDetails"> // </div> // </div> var objBody = document.getElementsByTagName("body").item(0); // create overlay div and hardcode some functional styles (aesthetic styles are in CSS file) var objOverlay = document.createElement("div"); objOverlay.setAttribute('id','overlay'); objOverlay.onclick = function () {hideLightbox(); return false;} objOverlay.style.display = 'none'; objOverlay.style.position = 'absolute'; objOverlay.style.top = '0'; objOverlay.style.left = '0'; objOverlay.style.zIndex = '90'; objOverlay.style.width = '100%'; objBody.insertBefore(objOverlay, objBody.firstChild); var arrayPageSize = getPageSize(); var arrayPageScroll = getPageScroll(); // preload and create loader image var imgPreloader = new Image(); // if loader image found, create link to hide lightbox and create loadingimage imgPreloader.onload=function(){ var objLoadingImageLink = document.createElement("a"); objLoadingImageLink.setAttribute('href','#'); objLoadingImageLink.onclick = function () {hideLightbox(); return false;} objOverlay.appendChild(objLoadingImageLink); var objLoadingImage = document.createElement("img"); objLoadingImage.src = loadingImage; objLoadingImage.setAttribute('id','loadingImage'); objLoadingImage.style.position = 'absolute'; objLoadingImage.style.zIndex = '150'; objLoadingImageLink.appendChild(objLoadingImage); imgPreloader.onload=function(){}; // clear onLoad, as IE will flip out w/animated gifs return false; } imgPreloader.src = loadingImage; // create lightbox div, same note about styles as above var objLightbox = document.createElement("div"); objLightbox.setAttribute('id','lightbox'); objLightbox.style.display = 'none'; objLightbox.style.position = 'absolute'; objLightbox.style.zIndex = '100'; objBody.insertBefore(objLightbox, objOverlay.nextSibling); // create link var objLink = document.createElement("a"); objLink.setAttribute('href','#'); objLink.setAttribute('title','Click to close'); objLink.onclick = function () {hideLightbox(); return false;} objLightbox.appendChild(objLink); // preload and create close button image var imgPreloadCloseButton = new Image(); // if close button image found, imgPreloadCloseButton.onload=function(){ var objCloseButton = document.createElement("img"); objCloseButton.src = closeButton; objCloseButton.setAttribute('id','closeButton'); objCloseButton.style.position = 'absolute'; objCloseButton.style.zIndex = '200'; objLink.appendChild(objCloseButton); return false; } imgPreloadCloseButton.src = closeButton; // create image var objImage = document.createElement("img"); objImage.setAttribute('id','lightboxImage'); objLink.appendChild(objImage); // create details div, a container for the caption and keyboard message var objLightboxDetails = document.createElement("div"); objLightboxDetails.setAttribute('id','lightboxDetails'); objLightbox.appendChild(objLightboxDetails); // create caption var objCaption = document.createElement("div"); objCaption.setAttribute('id','lightboxCaption'); objCaption.style.display = 'none'; objLightboxDetails.appendChild(objCaption); } // // addLoadEvent() // Adds event to window.onload without overwriting currently assigned onload functions. // function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function'){ window.onload = func; } else { window.onload = function(){ oldonload(); func(); } } } addLoadEvent(initLightbox); // run initLightbox onLoad Any help is much appreciated xx Similar TutorialsHello Everbody, I have been at this problem for 10 hours now and am going NUTS!! I am making website to look around an ancient Egyptian Tomb. Feel free to have a look: http://www.campbelltest.co.uk/britishMuseum/online/ I have a flash movie which I have scripted to utilise the browser back button using this script http://www.asual.com/swfaddress/docs/. This works fine until open a lightbox image form within the flash movie using Lokesh Dhakar Light box http://www.lokeshdhakar.com/projects/lightbox2/ and the browsers back button stops working!! The code below is to the JavScript links and the code that lauches the lightbox: Code: <script type="text/javascript" src="js/swfaddress-optimizer.js"></script> <script type="text/javascript" src="js/swfobject.js"></script> <script type="text/javascript" src="js/swfaddress.js"></script> <script type="text/javascript" src="js/swfmacmousewheel.js"></script> <script src="js/prototype.js" type="text/javascript"></script> <script src="js/scriptaculous.js?load=effects" type="text/javascript"></script> <script src="js/lightbox.js" type="text/javascript"></script> <!-- start | JC --> <!-- added for flash --> <!-- added for launch from flash --> <script language="JavaScript"> function openLightbox(url,group){ var objLink = document.createElement('a'); objLink.setAttribute('href',url); objLink.setAttribute('rel','lightbox['+group+']'); objLink.setAttribute('title','caption'); Lightbox.prototype.start(objLink); } </script> <!-- end | JC --> This code is how I have embeded the flash in the page: Code: <script type="text/javascript"> var so = new SWFObject('container04.swf', 'container04', '760', '450', '8', '#ffffff'); so.useExpressInstall('js/expressinstall.swf'); so.addParam('menu', 'false'); //so.addParam('movie','container04'); so.write('flashcontent'); var macmousewheel = new SWFMacMouseWheel( so ); </script> I have added a text box to movie that shows the back button function exicuting and what its exicuting. I have never done any work with JavaScript before so I am up the creek without a paddle!! I was wondering if it is possible to embed javascript within a lightbox. I believe a lightbox in most cases uses its own javascript code, but i am looking to have an unrelated javascript function working within the lightbox, under the image, if possible. Thanks in advance. I am making a website for school and have made a lightbox that works perfectly in all NEW browsers. Only, they use internet explorer 7. Because of this, the lightbox doesnt work properly, and instead sticks the the side of the screen, doesnt dim the background and simply doesnt work. Is there a different lightbox that will work for IE7? and how can i make a rule to only show it for browsers older than IE9? (I know of the html 'if lt ie9' rule if that helps) Thanks. Code: <? session_start(); if(!session_is_registered(myusername)){ header("location:index.php"); } ?> <?php //users data query $sesusername = $_SESSION['myusername']; $sespassword = $_SESSION['mypassword']; include_once("scripts/connect.php"); $memberquery = mysql_query("SELECT * FROM members WHERE username='$sesusername' AND password='$sespassword'"); while($row = mysql_fetch_assoc($memberquery)){ $id = $row['id']; $photo = $row['profile_picture']; $name = $row['name']; $username = $row['username']; $joined = $row['date_joined']; $password = $row['password']; $email = $row['email']; $freinds = $row['friends']; } ?> <?php //friends data $friendsquery = mysql_query("SELECT * FROM members"); while($row = mysql_fetch_assoc($friendsquery)){ $user = $row['name']; $userpic = $row['profile_picture']; $id = $row['id']; { $friend .='<img src="' . $userpic . '" style="width:100px; height:90px; vertical-align:middle"><a href="profile.php?id=' . $id . '"> ' . $user . '</a></br></br>' ; } } ?> <DOCTYPE HTML> <html> <head> <title>Dead psycho | Friends</title> <style type="text/css"> #friend_container{ display:none; background:#000000; opacity:0.7; filter:alpha(opacity=90); position:absolute; top:0px; left:0px; min-width:100%; min-height:100%; z-index:1000; } #friends_content{ display:none; position:fixed; top:100px; left:50%; margin-left:-200px; width:400px; max-height: 400px; background:#FFFFFF; padding:10px 15px 10px 15px; border:2px solid #a11e22; z-index:1001; -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; Overflow: scroll; } a{ color:#a11e22 ;} #friend{height:150px; width:150px;} </style> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("a#open_friends").click(function(){ $("#friend_container, #friends_content").fadeIn(300); }) $("a#close_friends").click(function(){ $("#friend_container, #friends_content").fadeOut(300); }) }) </script> <?php include_once("menu.php"); ?> </head> <body> <div id="container"> <div id="leftside"> <?php require_once("sidebar_left.php"); ?> </div> <div id="content"> <a id="open_friends" href="#"><b>All friends</b></a> <div id="friends_content"> <h2><center>Friends</center></h2> <hr width="90%" color="#a11e22"/> <?php echo "$friend"; ?> <br/> <b><center><a id="close_friends" href="#">Close</a></center></b> </div> <div id="friend_container"> </div></div> </div> <div id="footer" align="justify"> <?php include_once("scripts/copy.php"); ?> </div> </body> </html> I have the some text loaded in light box with background faded. i want the print button in the light box so that when user click on that only the contents of light box is printed and printer box opens up. How to do that?? I can get the lightbox to work perfectly fine, and I love how seamlessly it works, I however am running some more java script on my page and am running into some problems. When I apply the lightbox it takes away the functionality of my other script, and I am not sure why this is so. I am using 2.04 version of lightbox: http://www.huddletogether.com/projects/lightbox2/ Here is the other script that is getting either turned off or overridden, I'm not quiet sure. <script type="text/javascript"> $(document).ready(function() { //Set Default State of each portfolio piece $(".paging").show(); $(".paging a:first").addClass("active"); //Get size of images, how many there are, then determin the size of the image reel. var imageWidth = $(".window").width(); var imageSum = $(".image_reel img").size(); var imageReelWidth = imageWidth * imageSum; //Adjust the image reel to its new size $(".image_reel").css({'width' : imageReelWidth}); //Paging + Slider Function rotate = function(){ var triggerID = $active.attr("rel") - 1; //Get number of times to slide var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide $(".paging a").removeClass('active'); //Remove all active class $active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function) //Slider Animation $(".image_reel").animate({ left: -image_reelPosition }, 500 ); }; //Rotation + Timing Event rotateSwitch = function(){ play = setInterval(function(){ //Set timer - this will repeat itself every 3 seconds $active = $('.paging a.active').next(); if ( $active.length === 0) { //If paging reaches the end... $active = $('.paging a:first'); //go back to first } rotate(); //Trigger the paging and slider function }, 3750); //Timer speed in milliseconds (3 seconds) }; rotateSwitch(); //Run function on launch //On Hover $(".image_reel a").hover(function() { clearInterval(play); //Stop the rotation }, function() { rotateSwitch(); //Resume rotation }); //On Click $(".paging a").click(function() { $active = $(this); //Activate the clicked paging //Reset Timer clearInterval(play); //Stop the rotation rotate(); //Trigger rotation immediately rotateSwitch(); // Resume rotation return false; //Prevent browser jump to link anchor }); }); </script> I am assuming there is some conflict with either an onload..or something I'm really not sure I would greatly appreciate your help. Hi, I'm just putting the finishing touches on my new website and decided to include a custom scroll bar to really finish off the look of a couple of pages. I've managed to implement it successfully into one of my pages, however on another it seems to be a bit hit and miss as to whether it works in different browsers. After some experimentation I think I've managed to determine that the problem is that the javascript for the custom scrollbar is conflicting with some other javascript on the same page (lightbox image viewer). I came to this conclusion as prior to adding the custom scrollbar lightbox worked fine, and now after adding the addition javascript for the scrollbar lightbox has stopped working (and the scrollbar is hit and miss as to whether it works). In addition as I say, I have implemented the scrollbar into a different page (which doesn't have any other javascript to conflict with) which seems to work fine. Here's the page prior to adding the new scrollbar and with lightbox working: Here's the page with the scrollbar added and lightbox not working: The code that I suspect is conflicting is as follows: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Ryan Robinson | Gear</title> <!-- lightbox script --> <link rel="stylesheet" href="lightbox/css/lightbox.css" type="text/css" media="screen" /> <script type="text/javascript" src="lightbox/js/prototype.js"></script> <script type="text/javascript" src="lightbox/js/scriptaculous.js?load=effects,builder"></script> <script type="text/javascript" src="lightbox/js/lightbox.js"></script> <!-- scrollbar script --> <link rel="stylesheet" href="scrollbar/css/scrollbar_gear.css" type="text/css" media="screen"/> <script type="text/javascript" src="scrollbar/js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="scrollbar/js/jquery.tinyscrollbar.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#scrollbar1').tinyscrollbar(); }); </script> I could be wrong, but considering they work separately but whenever I put them together one or both stops it leads me to believe this must be the problem. Anyone have any idea of how I might fix this? (PS. I am still a bit of a noob when it comes to code, so please make any suggestions as simple as possible!) Thanks Hey all, Firebug gives me the below error message: component.singularize is not a function [Break on this error] var component = component.singularize(); This is what I have: Code: var component = window.location.hash.replace('#', ''); var component = component.singularize(); alert("The component name is " + component); var singularize = function(){ if(!String.prototype.singularize){ String.prototype.singularize = function(){ var context = this; result = ((context.charAt(context.length -1, 1) == 's') ? context.substring(0, context.length - 1) : context); return result; } } } Thanks for any response. This is about http://www.aecp.pt You will see this on the page, and I highlight the problem on the screenshot itself: http://skitch.com/ricardosalta/nk9g4...ub-de-portugal I know by trial and error that the problem is caused by the presence of image galleries like this on the homepage: http://skitch.com/ricardosalta/nk988...ub-de-portugal I use Mac; is there a good tool to find these incompatibilities? Anyway, I appreciate all the help you can gift me with. Any pointers will be much valuable. Thanks. All the best, Tatonka Hi there, A client of mine has asked me to change a flash component on his website to something that will work on the ipad/iphone etc. So my guess is that a javascript created slideshow would do the trick. Check out what I am meaning on this page: http://www.it-world.com.au/ It's the flash with "Our Services" "Our Products" "Contact" in it. Can anyone suggest a very easy javascript that I could manipulate to give this same scrolling effect on the click of a link. It needs to be very easy to make changes to as I have no js skills whatsoever other than copying, pasting and making minor changes to obvious pieces of script. hope someone can help! Thanks, Ross Hi, I'm currently working on a Flash pop-up that can be integrated in several websites. I'm currently testing the code. I've got a flash file with a semi-transparant background that loads over the complete page, it also closes the div with the flash content once the end of the swf is reached. The thing is, I want to prevent the user from scrolling whilst the swf is active. That's why I disabled the overflow-Y. Now I've got a javascript code that is supposed to change the body's overflow to visible again, and I'm calling to this code in the same frame as where I disable the div with the flash in it. But for some reason it isn't working. This is my complete Javascript code: Code: <script type="text/javascript"> <!-- Original: Gregor (legreg@legreg.de) --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> var ie4 = (document.all) ? true : false; var ns4 = (document.layers) ? true : false; var ns6 = (document.getElementById && !document.all) ? true : false; function hidelayer(lay) { if (ie4) {document.all[lay].style.visibility = "hidden";} if (ns4) {document.layers[lay].visibility = "hide";} if (ns6) {document.getElementById([lay]).style.display = "none";} } function writetolayer(lay,txt) { if (ie4) { document.all[lay].innerHTML = txt; } if (ns4) { document[lay].document.write(txt); document[lay].document.close(); } if (ns6) { over = document.getElementById([lay]); range = document.createRange(); range.setStartBefore(over); domfrag = range.createContextualFragment(txt); while (over.hasChildNodes()) { over.removeChild(over.lastChild); } over.appendChild(domfrag); } } <!-- This is the part I added which I thought would show the scrollbar again after the flashpopup is finished --> function showbar(){ document.getElementsByName('body')[0].style.overflowY = 'visible'; } </script> And in the final frame of my flash animation I first stop the swf, and then call to both functions: //stops the movie stop(); //this is the code that triggers the function to hide the div, and the function that should show the scrollbar getURL("javascript:showbar();"); getURL("javascript:hidelayer('newlayer');"); I've also got an online webtest he http://www.haragara.com/banner_test/ And I've included all the files in a zip Can anyone tell me what I'm doing wrong? is there javascript i can use to keep certain tabs open on a flash drop down menu?
I'm not too familiar with javascript and usually do most of my animation/linking with flash. However my client does not want flash because it can't be displayed on the iPhone. If you go he http://www.hosthabitat.com/think/bb2/index.html you will see a menu on the left that starts to scroll through the buttons while showing different images on the right. But if you hover over any button it stops on that image. The buttons are then linked to individual pages. I attempted to try and replicate this technique he http://www.hosthabitat.com/think/bb2/index_test.html However I am not sure how to write or modify my script so that it scrolls through the photos like my flash version does. Any help!!! I'm stuck! Is it possible to use GetVariable() on a variable outside the Main scene timeline? Im trying to get a variable that is set on "sprite 479" that is gonna run on frame #2.. the variable name is "myVariable" Code: function getElement() { var FlashArr = document.getElementsByName('myFlash'); return FlashArr[FlashArr.length-1]; } alert(getElement().GetVariable("myVariable")); I can only get variables located on the MainMovie sprite. Thank you. Hi, I am working on a project in which I have to open my flash demo in a modal window. I got all the code for modal window and it is working great. The only problem is I am not able to open a flash file in modal window. Can any one guide me or suggest me how should I fix this. Thanks in advance. Vikrant I am embedding a flash photo gallery object in an html page. The flash gallery has a param "thumbVisibility" that allows you to set the visibility of the thumbnails with the options "NEVER" and "ALWAYS." I have it set to "NEVER" so that the thumbs do not show when the object loads. That is how I want it. However, I would like to build a javascript method to create a toggle button to switch between "NEVER" and "ALWAYS" so that the thumbnails can be turned on and off by the end user. As a first step, I know that javascript can be used to pass params to flash objects but as a js noob I haven't been able to find a clear and concise tut to figure out how to do this. Of course, the second step is how to do this in a function where I could switch between the two options using a single toggle button. I would greatly appreciate it if someone could suggest an approach to the javascript required to solve this problem. Thanks in advamce for your assistance. Hi, I need a javascript that detects flash and replace z-index value. i have 2 div. div1 (alternate HTML content) has z-index=-3 and div2 (flash object) z-index=0. If flash is detected, do nothing. if flash is not detected, i would like to set div1 z-index to a positive 3. can someone please help me? Hi can Javascript talk to the flash plugin to access the microphone functionality? if so how can i do this? hi, I have created a flash video that work on a php table (like php-nuke), this is seen well on my PC, instead with various screen the video size is not good. ON screen big the video is small, on screen small the video is big... How i can made a script that change the dimension of flash video ? any idea ? please help me.. I have 3 tabs with a flash video playing in each. If a user clicks on a video and then decides to move to another tab while the video is playing.... the video stops and the tab is switched. I am using the code below to achieve that. Code: onClick=player1.sendEvent('STOP'); player2.sendEvent('STOP'); player3.sendEvent('STOP'); this works fine if I have the tabs appearing in sequence with player1 embedded in the first tab, player2 in the second and player3 in the third. However, I wanted to randomize the tabs, in which case if tab 3 containing player3 appears first and is played and then the user switches to another tab the video keeps playing.... meaning the above code does not work in that instance. I am at a loss here cause i thought that the onClick event should be going through all the players and stopping them. website: http://tinyurl.com/ydalz2r (at the moment the tabs are displayed in sequence) Hi, I'm trying to get my webcam feed embeded as a flash object. I have the url to the swf generated by the webcam software. If I copy and paste the url into IE's address bar, the webcam shows. However, the same url embeded into html does not work. This directly in IE address bar works. But doesn't in any other browser: Code: http://ipaddresshere/axis-cgi/mjpg/video.swf?resolution=320x240&camera=1 I've looked through the code from the webcam (Axis) admin page and copied the code for the flash option. Here is the code: Code: <html> <head></head> <body> <script language="Javascript"> var width = "320"; var height = "240"; var width_height = 'width="' + width + '" height="' + height + '"'; var view_NeedFlashPluginTxt = "You need a Shockwave Flash plugin, get it from:"; document.write('<EMBED src="http://ipaddresshere/axis-cgi/mjpg/video.swf?resolution=320x240'+'&camera=1" ' + 'quality=high bgcolor=#000000 ' + width_height + ' TYPE="application/x-shockwave-flash" swLiveConnect=TRUE' + ' PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">' + '</EMBED>' + '<NOEMBED>' + view_NeedFlashPluginTxt + '<a href="http://www.macromedia.com/shockwave/download/">Macromedia</a>.' + '</NOEMBED><br>'); </script> </body> </html> and this is the html the Javascript outputs: Code: <EMBED height=240 type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash width=320 src=http://ipaddresshere/axis-cgi/mjpg/video.swf?resolution=320x240&camera=1 swLiveConnect="TRUE" bgcolor="#000000" quality="high"> </embed/> Can anyone spot anything wrong with the code or perhaps suggest why it isn't working? |