Log in

View Full Version : Call lightbox from a flash file with buttons?



photoguy1601
06-01-2007, 09:47 AM
I may be trying to do something that is impossible?

I want to have full control of the design of my html-based homepage, therefore I am using flash files in the centre area of my hp. However, the next phase is to call my lightbox galleries from a flash file that have several buttons. I succeeded in doing so from just one button via html code. The question is, can I do this as well from a flash file with the getURL command?

I have a test site here www.kaaresmith.dk/_stills.html that shows the one button thing I've done.

I had hoped I could just accomplish what I want by drawing hotspots in Dreamweaver, but unfortunately that's not possible on swf's.

Hope I made myself clear!

Kaare

Medyman
06-01-2007, 11:04 PM
It's not impossible...it's quite possibe actually.

In fact, I'm planning to add a lightbox 2.0 and flash interaction on my website (i'm in the process or redesigning it and I keep changing the design every other day).

I'm going to assume that you have Lightbox setup in your document per the Lightbox documentation.

1) Insert the following "Delegate" somewhere between the head tags of your document:

<script type="text/javascript">
function LightboxDelegate(url,caption) {
var objLink = document.createElement('a');
objLink.setAttribute('href',url);
objLink.setAttribute('rel','lightbox');
objLink.setAttribute('title',caption);
Lightbox.prototype.start(objLink);
}
</script>

2) Add the correspoding linkage in your actionscript


PictureMC.onRelease = function() {
getURL("javascript:LightboxDelegate(image1.jpg','caption1')")
}


Disclaimer: I'm typing this directly into the forum so there might be sytax errors but it should work. Post back if you have any issues.

HTH

photoguy1601
06-03-2007, 09:45 AM
I forgot to mention that I need several pictures to show from one button. Do I make several javascripts then with different elements as in below: :confused:

<script type="text/javascript">
function LightboxDelegate(url,caption) {
var objLink = document.createElement('a');
objLink.setAttribute('href',url);
objLink.setAttribute('rel','lightbox[sport]');
objLink.setAttribute('title',caption);
Lightbox.prototype.start(objLink);
}
</script>

<script type="text/javascript">
function LightboxDelegate(url,caption) {
var objLink = document.createElement('b');
objLink.setAttribute('href',url);
objLink.setAttribute('rel','lightbox[concerts]');
objLink.setAttribute('title',caption);
Lightbox.prototype.start(objLink);
}
</script>

I'll try it out myself later today, so I'll get back to this issue myself, but thanks so far!

K

Medyman
06-03-2007, 05:04 PM
I'm not sure what exactly you mean here. Is it even possible to run two seperate instances of the lightbox at once?

I'm not really that familiar with the lightbox (i decided not to go that route so didn't look into it much, told u my design changes a lot).

In any case, if it's possible...then your logic would be right. If you can't get it work, I would post in the JS forum and see if someone can help you because the issue would be with two JS scripts not overlapping. The flash linking is pretty straightforward.

photoguy1601
06-03-2007, 10:14 PM
Hi again,

it is indeed possible to have several lightbox galleries on the same page, that's where the [] are used.

This is the javascript I typed in my header:

<script type="text/javascript">
function LightboxDelegate1(url,caption) {
var objLink = document.createElement('a');
objLink.setAttribute('href',url);
objLink.setAttribute('rel','lightbox[iceland]');
objLink.setAttribute('title',caption);
Lightbox.prototype.start(objLink);
}
</script>

<script type="text/javascript">
function LightboxDelegate2(url,caption) {
var objLink = document.createElement('a');
objLink.setAttribute('href',url);
objLink.setAttribute('rel','lightbox[hans]');
objLink.setAttribute('title',caption);
Lightbox.prototype.start(objLink);
}
</script>

This is the code in the flash button:

on (release) {
getURL("javascript:LightboxDelegate1('billeder/iceland/_MG_0725.jpg' , 'Seydisfjordur')");
}

on (release) {
getURL("javascript:LightboxDelegate2('billeder/hans/hans_01.jpg' , 'Hans Nielsen, dwarf')");
}

Strangely enough, the caption I enter in the flash file is necessary, but it is the title written in the html document that counts:

<a href="billeder/iceland/_MG_0725.jpg" rel="lightbox[iceland]" title="Seyðisfjörður, Iceland"></a>
<a href="billeder/iceland/_MG_0714.jpg" rel="lightbox[iceland]" title="Seyðisfjörður, Iceland"></a>

<a href="billeder/hans/hans_01.jpg" rel="lightbox[hans]" title="Hans Nielsen, dværg"></a>
<a href="billeder/hans/hans_02.jpg" rel="lightbox[hans]" title="Hans Nielsen, dværg"></a>
<a href="billeder/hans/hans_03.jpg" rel="lightbox[hans]" title="Hans Nielsen, dværg"></a>
<a href="billeder/hans/hans_04.jpg" rel="lightbox[hans]" title="Hans Nielsen, dværg"></a>

But HEUREKA! It works! :rolleyes:

http://www.kaaresmith.dk/test.html

Thanks a zillion, Medyman!

Cheers, Kaare

photoguy1601
06-03-2007, 10:16 PM
Argh, hold on..:eek:

Tested the site on my wife's pc with IE 6 and I just get a grey screen there - do you have any idea, how to solve that, or should I make a new post in the Java forum? It works on Firefox on the PC as well...

K

Medyman
06-07-2007, 06:55 PM
Yes, seek a javascript expert. It has to be something with the Javascript (which I know very little about).

Charlene1
06-15-2007, 04:34 AM
Hey guys! This is awesome! Totally what I was looking for!

Medyman - do you have any idea if you can make this work on images loaded dynamically from an XML file? So that it loads the picture that showing when you click on the moviclip?

Is it possible? could be as simple as replacing 'image1.jpg' with something else that calls the image? or is it more complicated than that? Any help would be brilliant!

I'm somewhat new at this, and I got the lightbox working, but it would change my world if i could this! heh


It's not impossible...it's quite possibe actually.

In fact, I'm planning to add a lightbox 2.0 and flash interaction on my website (i'm in the process or redesigning it and I keep changing the design every other day).

I'm going to assume that you have Lightbox setup in your document per the Lightbox documentation.

1) Insert the following "Delegate" somewhere between the head tags of your document:

<script type="text/javascript">
function LightboxDelegate(url,caption) {
var objLink = document.createElement('a');
objLink.setAttribute('href',url);
objLink.setAttribute('rel','lightbox');
objLink.setAttribute('title',caption);
Lightbox.prototype.start(objLink);
}
</script>

2) Add the correspoding linkage in your actionscript


PictureMC.onRelease = function() {
getURL("javascript:LightboxDelegate(image1.jpg','caption1')")
}


Disclaimer: I'm typing this directly into the forum so there might be sytax errors but it should work. Post back if you have any issues.

HTH

Medyman
06-15-2007, 05:26 PM
Why don't you try it and see...

Yes, that is how you would change which image came up in the lightbox when you clicked it...

Change "image1.jpg" to w/e image you wanted to show up and change "caption1" to whatever you want the caption to be.

HTH :)

Charlene1
06-16-2007, 08:01 PM
Do you have any idea how to do that with images loaded dynamically from an XML file? I tried a few things but didn't work. Any ideas? Here's the code....


function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._xscale = target_mc._yscale = 75;
target_mc._x = hit_left._x+(target_mc._width+5)*k;
target_mc.pictureValue = k;
smoothImageLoad(thumbnails[k], target_mc);
target_mc.onRelease = function() {
getURL("javascript:LightboxDelegate('images/eyes1.jpg',' ')");
};
target_mc.onRollOver = function() {
this.swapDepths(thumbnail_mc.getNextHighestDepth());
this._alpha = 50;
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}


Why don't you try it and see...

Yes, that is how you would change which image came up in the lightbox when you clicked it...

Change "image1.jpg" to w/e image you wanted to show up and change "caption1" to whatever you want the caption to be.

HTH :)

Charlene1
07-04-2007, 04:13 PM
DId you get your lightbox working in IE medyman? (just curious) I've found 3 ppl now with the same problem of this working in every browser except IE, but can not find a solution. Unfortunately I have an understand in of AS, but not js at all!

If you found a solution to share, you would make our month!! :D

Thanks in advance, and thanks again for all your solid advice thus far!!


Yes, seek a javascript expert. It has to be something with the Javascript (which I know very little about).

Medyman
07-05-2007, 01:15 AM
Hey Charlene...

I actually never used this technique. I'm not sure what could be causing the incompaibitly in IE.

Again, I'm going to refer you the JS forum for some help with this issue. Sorry that I can't help more.

Charlene1
07-05-2007, 10:14 AM
Oh sorry - i misread your post. It does say you were "planning" on using this for your website :) I thought I read that you had and was grasping at straws.:o

Both i and the other person on this thread have posted on the JS forum, no luck as of yet. If i find something, I'll post it here though!!

Thanks for your quick reply! Hope your redesign is going well! :D
Hey Charlene...

I actually never used this technique. I'm not sure what could be causing the incompaibitly in IE.

Again, I'm going to refer you the JS forum for some help with this issue. Sorry that I can't help more.

Medyman
07-05-2007, 02:55 PM
I was going to use the lightbox but I decided to go in another direction. As I also stated, I'm very indecisive when it comes to my own website.

You might be able to find some answers here: http://www.huddletogether.com/forum/

shush1
07-23-2007, 02:52 PM
Photoguy1601

I want to create something similar to what you have interms of lightbox to show my portfolio, how can I create something similar to what you have? I just need my flash sits portfolio to open a image over my flash site and be abl to hit next to the other images.

Could you please advice as to how I can achieve this

thanx

Medyman
07-23-2007, 03:03 PM
Charlene, Photoguy:

I actually changed my plans (again) and now am using lightBox on my website. I was able to make it work perfectly in IE as well as other browsers.

If you still need some help, I'd be happy to share my code with you.


Shush:
Read the beginning of this thread. I've explained exactly how to do this. The first step would be to get lighbox working without flash and then move onto flash and JS interaction. :)

Post back if you have any questions.

Charlene1
07-25-2007, 04:26 AM
oh yes, please share! What did you do?

oMG - I've been searching and searching!! I'm so excited!

Medyman
07-28-2007, 08:05 PM
Sorry for the delay. The last few days have been hectic. Here is a working example. I've tested in IE7, IE6, FF, IE/Mac, Safari, FF/Mac. It works beautifully.

Here (http://www.demos.designsbyvishal.com/dynamicdrive/lightbox/) is the live demo.
All of the source files are zipped and uploaded here (http://www.demos.designsbyvishal.com/dynamicdrive/lightbox/Designs by Vishal - Lightbox & Flash.zip).

This example is used for an online portfolio. There is a looping slideshow with three images. The expand button starts the lightbox script. I didn't get the change to make a dedicated demo so this is the page, as is (or more like was.) I'll include the relevant coding below. You can download the full source code in the zip file posted above.

Note: Pay attention to the portfolio.js file.

ActionScript 2.0


expand.onRelease = function() {
getURL("javascript:show(1)");
}

HTML

<html>
<head>
<title>Designs by Vishal</title>
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<script type="text/javascript" src="js/portfolio.js"></script>

<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />


</head>

<body>


<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="919" height="300" id="Designs by Vishal" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="portfolio/Designs by Vishal.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="portfolio/Designs by Vishal.swf" quality="high" bgcolor="#ffffff" width="919" height="300" name="Designs by Vishal" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

<div id="script">
<a id="dbv1" href="images/portfolio/dbv/screenshots/1.jpg" rel="lightbox[dbv]" title="Designs by Vishal"></a>
<a id="dbv2" href="images/portfolio/dbv/screenshots/2.jpg" rel="lightbox[dbv]" title="Designs by Vishal"></a>
<a id="dbv3" href="images/portfolio/dbv/screenshots/3.jpg" rel="lightbox[dbv]" title="Designs by Vishal"></a>
</div>



</body>
</html>

JS

function show(image) {
var a = document.getElementById("dbv"+image+"");
var f = new Array()
f[1] = "images/portfolio/dbv/screenshots/1.jpg";
f[2] = "images/portfolio/dbv/screenshots/2.jpg";
f[3] = "images/portfolio/dbv/screenshots/3.jpg";
var url = f[image];
a.setAttribute('href', url);
myLightbox.start(a);
}


Hope this helps you all out. Post any more questions, I'll try to be of help.

Charlene1
07-28-2007, 09:03 PM
You are a STAR!!! Thank you thank you!!!

Charlene1
07-28-2007, 10:35 PM
ok - i got one of the links working and was super happy. Now my problem is getting more that one button on a page with different portfolios working.

I put the js directly into the html (like the example in previous posts for more than one) and renamed each function matching what each button calls the js function in as. It worked great in FF! but to no avail in IE - it will read the first js but not the next ones???:confused: Any ideas?

here's what i have thus far...

<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<script type="text/javascript" src="js/swfobject.js"></script>

<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />

<script type="text/javascript">
function portfolio(image) {
var a = document.getElementById("editorial"+image+"");
var f = new Array()
f[1] = "images/eyes1.jpg";
f[2] = "images/eyes2.jpg";
f[3] = "images/eyes3.jpg";
var url = f[image];
a.setAttribute('href', url);
myLightbox.start(a);
}
</script>

<script type="text/javascript">
function showb(image) {
var a = document.getElementById("identity"+image+"");
var f = new Array()
f[1] = "images/CB-Logo.jpg";
f[2] = "images/empireyellow.jpg";
f[3] = "images/empirered.jpg";
var url = f[image];
a.setAttribute('href', url);
myLightbox.start(a);
}
</script>

</head>

<body bgcolor="#808160">

<div id="script">
<a id="editorial1" href="images/eyes1.jpg" rel="lightbox[editorial]" title="Editorial"></a>
<a id="editorial2" href="images/eyes2.jpg" rel="lightbox[editorial]" title="Editorial"></a>
<a id="editorial3" href="images/eyes3.jpg" rel="lightbox[editorial]" title="Editorial"></a>
<a id="identity1" href="images/CB-Logo.jpg" rel="lightbox[identity]" title="Charlene Burris - logo"></a>
<a id="identity2" href="images/empireyellow.jpg" rel="lightbox[identity]" title="Empire S.C. - logo"></a>
<a id="identity3" href="images/empirered.jpg" rel="lightbox[identity]" title="Empire S.C. - logo"></a>
</div>

<script type="text/javascript">
var so = new SWFObject("home2.swf", "flashmovie", "990", "520", "8", "#808160");
so.addParam("movie", "home2.swf");
so.addParam("quality", "high");
so.addParam("bgcolor", "#808160");
so.addParam("align", "t");
so.addParam("allowScriptAccess", "always");
so.write("flashcontent");
</script>

and the as obviously

on (release) {
getURL("javascript:portfolio(1)");
}
on (release) {
getURL("javascript:showb(1)");
}

Bramus!
07-28-2007, 10:41 PM
As the need of having this automated is not that weird, I've created a javascript class which sits between the swf and lightbox that automates it all.

Project Page : http://www.bram.us/projects/flashlightboxinjector/
Demo Page : http://www.bram.us/demo/projects/flashlightboxinjector/

Have fun!
Bramus!

Charlene1
07-29-2007, 07:03 PM
Hey Bramus!, that's really awesome! but i can't get it to work at all! I added the ID tag to all the images as well as uploaded and added the js file in the html and then put ....

import flash.external.*;

btn_editorial.onRelease = function() {
ExternalInterface.call("myFlashLightBoxInjector.start", "editorial1");
}

into the flash actions and nothing!! is there more to it? Your instructions seem to suggest not.

Also I have 3 buttons on my page with 3 seperate protfolios that i need to work. I couldn't see how to make that happen. I couldn't even get one to work so... I don't know....

you know I was trying to do something very similar to your example which is awesome, but that got scraped.

As the need of having this automated is not that weird, I've created a javascript class which sits between the swf and lightbox that automates it all.

Project Page : http://www.bram.us/projects/flashlightboxinjector/
Demo Page : http://www.bram.us/demo/projects/flashlightboxinjector/

Have fun!
Bramus!

Charlene1
07-29-2007, 07:38 PM
well nevermind Medyman - it actually seems to be working. It appears that the reason I couldn't get it to work in IE with that code is that IE was cacheing the swf file. So i kept refreshing and it wasn't working when it really kept trying to read the same swf file from a new html file. HAH! URGH! (I feel a little stupid - heh)

Works now! You're brilliant Medyman!! Thank you again!!

Bramus!
07-29-2007, 10:11 PM
Hey Bramus!, that's really awesome! but i can't get it to work at all! I added the ID tag to all the images as well as uploaded and added the js file in the html and then put ....

import flash.external.*;

btn_editorial.onRelease = function() {
ExternalInterface.call("myFlashLightBoxInjector.start", "editorial1");
}

into the flash actions and nothing!! is there more to it? Your instructions seem to suggest not.

edit the start function of myFlashLightBoxInjector to do an alert of some sort to see if it actually gets called. And sure your id's (on the a elements) are set correctly?


Also I have 3 buttons on my page with 3 seperate protfolios that i need to work. I couldn't see how to make that happen. I couldn't even get one to work so... I don't know....Same method as above should be used, just make sure your HTML output of your a elements have the right rel set to support sets (rel="lightbox[set1]", rel="lightbox[set2]", etc.)

SAB++
08-09-2007, 04:34 PM
Hi ,

Concerning Flash & Lightbox 2, It doesn't work for me... :(

I tried the same scripts

--------head / HTML :
<link rel="stylesheet" href="LB/css/lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="LB/js/prototype.js"></script>
<script type="text/javascript" src="LB/js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="LB/js/lightbox.js"></script>

<script type="text/javascript">
function LightboxDelegate(url,caption) {
var objLink = document.createElement('a');
objLink.setAttribute('href',url);
objLink.setAttribute('rel','lightbox');
objLink.setAttribute('title',caption);
Lightbox.prototype.start(objLink);
}
</script>

--------body / HTML :
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
type="application/x-shockwave-flash" data="btn.swf" width="150" height="70">
<param name="movie" value="btn.swf" />
<param name="wmode" value="transparent" />
<param value="high" name="quality" />
<embed src="btn.swf" wmode="transparent"></embed>
</object>

<a href="LB/images/bisounours.jpg" rel="lightbox"
title="Description de l'image 1"></a>

----------In flash, the button :
on (release) {
getURL("javascript:LightboxDelegate('LB/images/bisounours.jpg' , 'Description de l'image 1')");
}

Can you help me ? Thank you so much !

Charlene1
08-09-2007, 04:48 PM
Hi ,

Concerning Flash & Lightbox 2, It doesn't work for me... :(

I tried the same scripts

}

Can you help me ? Thank you so much !
read the rest of this thread - we all had problems with this code. the code medyman posted in the end works perfectly!. There's also the "flash injector" someone created and posted about in this thread.

dynamicfalcon
08-19-2007, 09:47 PM
I'm trying to figure out the needed actionscript code for my flash button if im using the following lightbox code.

<script type="text/javascript">
function LightboxDelegate1(url,caption) {
var objLink = document.createElement('a');
objLink.setAttribute('href',url);
objLink.setAttribute('rel','lightbox[dailynews]');
objLink.setAttribute('title',caption);
Lightbox.prototype.start(objLink);
}
</script>

dynamicfalcon
08-19-2007, 10:47 PM
I'm trying to figure out the needed actionscript code for my flash
button(s) if im using the following lightbox code. i want each button to
open its own group of images.

Thanks a trillion :)

<script type="text/javascript">
function LightboxDelegate1(url,caption) {
var objLink = document.createElement('a');
objLink.setAttribute('href',url);
objLink.setAttribute('rel','lightbox[dailynews]');
objLink.setAttribute('title',caption);
Lightbox.prototype.start(objLink);
}
</script>

<script type="text/javascript">
function LightboxDelegate2(url,caption) {
var objLink = document.createElement('a');
objLink.setAttribute('href',url);
objLink.setAttribute('rel','lightbox[music]');
objLink.setAttribute('title',caption);
Lightbox.prototype.start(objLink);
}

my testing page ...
</script>http://www.meanwhiledesign.net/test.html

Medyman
08-20-2007, 12:39 AM
You didn't read the whole topic before you posted.

I first posted the LightboxDelegate JS in hopes that i would work. It did in some of my testing but other people have had problems with it in IE.

I then reworked a solution and again posted it here. You can see it at: http://www.dynamicdrive.com/forums/showpost.php?p=102522

If you're still having problems. Feel free to post back.

Medyman
08-20-2007, 01:20 AM
Scott...

I emailed you back.

dynamicfalcon
08-20-2007, 01:33 AM
I cant see where getURL("javascript:show(1)");
calls on the images in your code.

I Im trying to use several flash buttons to call there own groups of images?

ie button1 will open group1 gallery / button 2 will open group 2 gallery

SAB++
08-21-2007, 01:37 PM
Thank you for answering Charlene ! ;)

It works perfectly but now the swf underlay dissapears totally !!!!!

What can I do to let the swf visible behind the lightbox working ???

Thank you in advance !!! ;)

Medyman
08-21-2007, 04:18 PM
You don't want the swf working under it. It's going to create a ton of problems for you. The main one being that your lighbox won't appear on top of it.

If you still want to get rid of that functionality, you'll need to edit the lightbox js.

SAB++
08-21-2007, 05:43 PM
You don't want the swf working under it
>> In fact, I just want the swf doesn't dissapear from the screen.

For example, this site : http://www.brainstorms.it/galleria/gallery_flash.html
The swf behind stay in place.

Concerning the lightbox.js, I'm too bad in javascript but I think it would be great to create a function like showImage() but for the swf or Element.visible (stuff.swf'); Something like that.

If you know the code, you're welcome

Thanks in advance :D

Medyman
08-21-2007, 06:07 PM
You could just add a screenshot of your flash file as the background of the div. That would be an easy workaround...

SAB++
08-21-2007, 06:19 PM
Why not ? good idea ! I'll try and by the way if I find a script I'll tell you.

Thx a lot :D

raurey
08-29-2007, 08:35 PM
Thank you for answering Charlene ! ;)

It works perfectly but now the swf underlay dissapears totally !!!!!

What can I do to let the swf visible behind the lightbox working ???

Thank you in advance !!! ;)

I'm having this same problem. When I trigger lightbox to open, the flash file completely disappears. Does anybody know what would cause this? If I were to guess, i'd say it's something in the object code for the flash file, but I can't seem to get anything to work. The object code I'm using to embed the flash is:


<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="100%" height="100%" id="using/website" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="fullscreen.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent">
<param name="scale" value="noscale" />
<param name="salign" value="lt" />
<embed src="fullscreen.swf" quality="high" scale="noscale" salign="lt" bgcolor="#535353" width="100%" wmode="transparent" height="100%" name="using/website" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

Thanks!

senixon
09-19-2007, 07:23 PM
I'm having this same problem. When I trigger lightbox to open, the flash file completely disappears. Does anybody know what would cause this? If I were to guess, i'd say it's something in the object code for the flash file, but I can't seem to get anything to work. ...

This is a SETTING in lightbox.js -- because some browsers mostly on MACs have problems with layering of DHTML and FLASH... as far as I know there is NO Workaround for that problem... so you have to choose a consistent look for all browsers (flash hidden) or kind of broken look for some people on Macs with FF/Safari (flash visibible)... maybe others. :rolleyes:

schorri
09-23-2007, 04:37 PM
hi,

downloaded de source code, but i encounter a problem,

this loads pictures from flickr, is there a possibility to load the pictures from a directory on the webspace of harddisk,

where do i have to put the buttons to make the pictures appear?

thanks

schorri
09-24-2007, 06:19 AM
hi SAB

could you please post the fla that you used in the example site,

if it's too difficult to post it here, you could also send it to mail, schorrie01@hotmail.com

thanks,

SAB++
10-04-2007, 08:24 PM
Hi Scorri,

This website is an example that I found. It's not mine (It would be great 'cause I still have the problem with my swf)

Sorry :(

ricfil
10-13-2007, 12:17 AM
Hi everybody...
Could some1 tell me if I trie to do this tests on my local machine gonna works!? or I have to test online?!?!?!

Normando
04-15-2008, 03:55 PM
Thanks Medyman.. the code you posted really helped me out of a jam.

My swf file was utilizing JavaScriptFlashGateway. The way that the flash object was embedded on the page prevented me from using an href on the flash object itself.. thus I needed to add the lightbox call inside the flash object itself. I had to send a couple new parameters to the swf file through the gateway for the lightbox source file and caption.

danieltorres086
06-26-2008, 03:11 AM
Hello Mr Madyman,
The source link is not working anymore, could you please fix it.

Thanks.!

Medyman
06-26-2008, 03:04 PM
There are better ways to do it than the techniques that I showed in this thread. You can view my files here (http://www.visualbinary.net/files/tutorials/lightbox/as2/), for a better way.

This particular example uses Lightbox++ (http://www.codefidelity.com/blog/?page_id=7), but the same technique will work with regular Lightbox.

danieltorres086
07-03-2008, 11:36 PM
Could you please post a zip or rar file with all the files of a sample working. I haven't had any succed.

My email is
danieltorres086@gmail.com
Thanks a lot.

Medyman
07-07-2008, 06:41 PM
The link above is incorrect. My apologies.

The correct URI is http://www.visualbinary.net/files/tutorials/lightbox/flash/as2/.

I will update the source files on the page to include all the files, including Lightbox++ as soon as I can.

danieltorres086
07-10-2008, 07:15 PM
thanks!

kasigratis
01-20-2010, 07:47 AM
It's not impossible...it's quite possibe actually.

In fact, I'm planning to add a lightbox 2.0 and flash interaction on my website (i'm in the process or redesigning it and I keep changing the design every other day).

I'm going to assume that you have Lightbox setup in your document per the Lightbox documentation.

1) Insert the following "Delegate" somewhere between the head tags of your document:

<script type="text/javascript">
function LightboxDelegate(url,caption) {
var objLink = document.createElement('a');
objLink.setAttribute('href',url);
objLink.setAttribute('rel','lightbox');
objLink.setAttribute('title',caption);
Lightbox.prototype.start(objLink);
}
</script>

2) Add the correspoding linkage in your actionscript


PictureMC.onRelease = function() {
getURL("javascript:LightboxDelegate(image1.jpg','caption1')")
}


Disclaimer: I'm typing this directly into the forum so there might be sytax errors but it should work. Post back if you have any issues.

HTH

I'm trying ti make something like this, when I click the button on the flash, the flash gone but the light box image didn't comes up. at bottom of the flash i put an image and when i click the image, the lightbox work very well.
I don't know why. Any body can help?

This is the script that I use:

HTML

<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>index</title>
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
<link href="style.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<!--flash lightbox script-->
<script type="text/javascript">
function LightboxDelegate(url,caption) {
var objLink = document.createElement('a');
objLink.setAttribute('rel','lightbox');
objLink.setAttribute('href',url);
objLink.setAttribute('title',caption);
Lightbox.prototype.start(objLink);
}
</script>

<!--end-->
</head>
<body bgcolor="#ffffff">
<div align="center" id="wraper">
<p>
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '1000',
'height', '593',
'src', 'index',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'index',
'bgcolor', '#ffffff',
'name', 'index',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'index',
'salign', ''
); //end AC code
}
</script>
</p>
<noscript>
<p>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="1000" height="593" id="index" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="index.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent">
<param name="bgcolor" value="#ffffff" />
<embed src="index.swf" wmode="transparent" quality="high" bgcolor="#ffffff" width="1000" height="593" name="index" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
<a href="images/bar.jpg"></a></p>
</noscript>
<a rel="lightbox" href="images/bar.jpg"><img src="images/arrow.jpg" width="13" height="10" border="0"></a></div>
</body>
</html>


flash

PictureMC.onRelease = function() {
getURL("javascript:LightboxDelegate('images/bar.jpg','caption1')");
}

kasigratis
01-20-2010, 07:49 AM
Double post
Can you send me your flash and lightbox?
Is it different between lighbox 2 and lightbox++?
Thanks

Cyn
05-05-2010, 03:39 PM
The menu is controlled by the menu.xml and some of the code appears like this:

<?xml version="1.0" encoding="utf-8" ?>
<items>
<item>
<text>HOME</text>
<url>home.swf</url>
</item>

<item>
<text>ABOUT US</text>
<url>about.swf</url>
</item>

can a javascript window/ or any window be called from the xml file executed by the swf file? Or do I need to put the javascript from earlier posts in the fla file, Thanks, Cyn

BLiZZaRD
05-05-2010, 07:43 PM
inside the FLA will help prevent problems.

In the future please start a new thread. Reviving old dead threads is confusing to many people just browsing for help. ;)

rdub
05-25-2010, 06:41 PM
I'm confused. How would you change code for AS 3?

verocom
08-26-2010, 12:25 PM
The link above is incorrect. My apologies.

The correct URI is http://www.visualbinary.net/files/tutorials/lightbox/flash/as2/.

I will update the source files on the page to include all the files, including Lightbox++ as soon as I can.

Is there a link somewhere to upload the files ?!
Thanx a lot, I was looking for something to help me for a long time !

4sumit
04-27-2011, 07:31 AM
yeah, i did it, but on my Linux server when i run this an error occured that

"
Message: 'Lightbox' is undefined
Line: 24
Char: 3
Code: 0
"
Please help me out! why it's happend?




It's not impossible...it's quite possibe actually.

In fact, I'm planning to add a lightbox 2.0 and flash interaction on my website (i'm in the process or redesigning it and I keep changing the design every other day).

I'm going to assume that you have Lightbox setup in your document per the Lightbox documentation.

1) Insert the following "Delegate" somewhere between the head tags of your document:

<script type="text/javascript">
function LightboxDelegate(url,caption) {
var objLink = document.createElement('a');
objLink.setAttribute('href',url);
objLink.setAttribute('rel','lightbox');
objLink.setAttribute('title',caption);
Lightbox.prototype.start(objLink);
}
</script>

2) Add the correspoding linkage in your actionscript


PictureMC.onRelease = function() {
getURL("javascript:LightboxDelegate(image1.jpg','caption1')")
}


Disclaimer: I'm typing this directly into the forum so there might be sytax errors but it should work. Post back if you have any issues.

HTH