PDA

View Full Version : Two questions re lightbox and flash



boogooloo1
04-06-2007, 12:10 AM
1) Script Title: lightbox

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/lightbox2/index.htm

3) Describe problem: G'day guys,

Firstly, has anyone figured out how to use lightbox 2 inside Flash yet? Would be nice, because the current way I'm doing it (using lightbox 1 inside Flash) doesn't allow me to add hyperlinks to the caption text.

Secondly, I can't figure out how to get rid of the "click to activate" thing for my swf without breaking lightbox - does anyone know how to fix this?

Cheers!

Watto :)

boogooloo1
04-07-2007, 01:35 PM
Bump :)

jscheuer1
04-07-2007, 02:34 PM
Your question doesn't make much sense. I don't see how disabling the 'click to activate' feature of Flash could possibly affect anything in the .swf itself. Also, most people want to put the .swf in lightbox, not the other way around as you seem to be asking.

If you really are putting lightbox in .swf, this would be more of a Flash than a DD script question anyway. And, if you are, how?

boogooloo1
04-07-2007, 11:03 PM
G'day mate,

Thanks for your reply! Gather you haven't heard of flashlightbox or flashlightbox2? It's a way of launching lightbox using buttons in Flash. You can check it out here - http://www.huddletogether.com/projects/lightbox/

Anyway, believe me when I tell you, when I add the code I usually use for disabling "click to activate" the lightbox breaks. The reason I posted here is that I don't think it's a Flash problem - it's when I add the code to the html page that there's a problem.

Here is the working page (using the technique explained in the flashlightbox download):


<html xmlns="http://www.w3.org/1999/xhtml " xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Simon Watson Design</title>
<style type="text/css">
@import "lightbox.css";
img { border:0; }
</style>
<script type="text/javascript" src="lightbox.js "></script>
</head>
<body bgcolor="#ffffff">
<p>&nbsp;</p>
<p align="center">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="720" height="520" id="Design" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="design-site.swf" /><param name="quality" value="high" /> <param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="design-site.swf" quality="high" wmode="transparent" bgcolor="#f6f6f4" width="720" height="520" name="Design" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage=" http://www.macromedia.com/go/getflashplayer " />
</object>
</p>
</body>
</html>

...and here's the broken page:


<html xmlns="http://www.w3.org/1999/xhtml " xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Simon Watson Design</title>
<style type="text/css">
@import "lightbox.css";
img { border:0; }
</style>
<script type="text/javascript" src="lightbox.js "></script>
</head>
<body bgcolor="#ffffff">
<p>&nbsp;</p>
<p align="center">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="720" height="520" id="Design" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="design-site.swf" /><param name="quality" value="high" /> <param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="design-site.swf" quality="high" wmode="transparent" bgcolor="#f6f6f4" width="720" height="520" name="Design" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage=" http://www.macromedia.com/go/getflashplayer " />
</object>
<script type="text/javascript" src="fixit.js"></script>
</p>
</body>
</html>

...and lastly, here's the js I'm using for the click to activate thing (which works fine, but breaks lightbox):


theObjects = document.getElementsByTagName("object");
for (var i = 0; i < theObjects.length; i++) {
theObjects[i].outerHTML = theObjects[i].outerHTML;
}

Sorry about the long post! Here are the pages if you want to compare them:

http://design.simonwatson.com.au/index.html

http://design.simonwatson.com.au/index2.html

As you can see, the first one has working lightbox, but you have to click to activate, whereas the second page has a broken lightbox, with NO click to activate.

Appreciate your help and patience!

:)

jscheuer1
04-08-2007, 12:04 AM
That outerHTML fix is one of the least reliable. Try this one:


<html xmlns="http://www.w3.org/1999/xhtml " xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Simon Watson Design</title>
<style type="text/css">
@import "lightbox.css";
img { border:0; }
</style>
<script type="text/javascript" src="lightbox.js "></script>
</head>
<body bgcolor="#ffffff">
<p>&nbsp;</p>
<p align="center">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="720" height="520" id="Design" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="design-site.swf" /><param name="quality" value="high" /> <param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="design-site.swf" quality="high" wmode="transparent" bgcolor="#f6f6f4" width="720" height="520" name="Design" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage=" http://www.macromedia.com/go/getflashplayer " />
</object>
</noscript>
<script type="text/javascript" src="design-site.js"></script>
</p>
</body>
</html>

Then, in design-site.js have this code:


document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="720" height="520" id="Design" align="middle"> \n\
<param name="allowScriptAccess" value="sameDomain" \/>\n\
<param name="movie" value="design-site.swf" \/><param name="quality" value="high" \/> <param name="wmode" value="transparent" \/><param name="bgcolor" value="#ffffff" \/><embed src="design-site.swf" quality="high" wmode="transparent" bgcolor="#f6f6f4" width="720" height="520" name="Design" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage=" http://www.macromedia.com/go/getflashplayer " \/>\n\
<\/object>');

boogooloo1
04-08-2007, 12:43 AM
Mate, you're a legend - worked beautifully!!!

Thank you!!!

:):):)