PDA

View Full Version : Lightbox from flash does not work with iExplorer



photoguy1601
06-05-2007, 12:58 PM
Hi there,

I have just updated my homepage with a swf file on the html based template of my homepage. The swf calls for the lightbox javascript from three buttons (movieclips, really). It works swell on all my browsers on my mac (opera, firefox, safari and camino) as well as on firefox on pc. But of course iExplorer refuses to work...

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

Does anyone have an idea of what the problem is? I mean, lightbox called from a normal html-based button works fine with iExplorer, so what is the issue when called from a swf-file?

I am not really a coder, more of a copy-and-paste-kind-of-guy so I don't have a clue as to what be looking for. :confused:

I hope I have provided enough information, otherwise I'll promptly write back.

Kaare

NicoJ
07-01-2007, 12:09 PM
Hi everybody ! (I'm a new user of this forum)
I have exactly the same problem of photoguy1601. Does anybody have an answer ?

Thanks

NicoJ
07-01-2007, 02:59 PM
For information here is the code:

JavaScipt:

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

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


html:

<a href="images/paysage1.JPG" rel="lightbox[paysages]" title="Montagne"></a>
<a href="images/paysage2.JPG" rel="lightbox[paysages]" title="Lac L&#233;man"></a>

<a href="images/portrait1.JPG" rel="lightbox[portraits]" title="Claude, Vidy"></a>
<a href="images/portrait2.JPG" rel="lightbox[portraits]" title="Bernard, Vidy"></a>


ActionScript in Flash

on (press) {
getURL("javascript:LightboxDelegate1('images/paysage1.JPG' , 'Montagne')");
}

on (press) {
getURL("javascript:LightboxDelegate2('images/portrait1.JPG' , 'Claude, Vidy')");
}


I want each button to open a gallery in the lightbox. But now when I click on the button I have only a dark screen and no lightbox.

Thanks

???
07-01-2007, 03:20 PM
Well, hehe. Javascript:blahblahblah, might not be what you're looking for, because I think it will open a blank page with that, since it's being done by the AS, not the JS. What you want for AS is external interface. You have to import something, then do externalInterface.call("jsfunc","param1","param2"); and you can have as many parameters as you want. Although if you problem is only with IE, you could add an FSCommand because it only works in IE, but I forgot quite how you use it.

PS: It's called JavaScript, NOT Java. Java is a different programming language.

NicoJ
07-01-2007, 08:34 PM
The problem is only with ie. I try with Firefox and it works.

How to add a FSCommand ? It can work with that command ? (I'm a beginner...)

Thanks:-)

Charlene1
07-04-2007, 04:08 PM
Hiya! I'm having the exact same problem too! Works in every browser but IE. I get the grey transparency accross the screen and flash movie dissapears, but no js pop up windows with pics. urgh!:mad:

I understand AS ok, but don't know js at all! Anyone have any ideas? What about this FSCommand? If anyone could help at all, it would be great!! It appears that everyone here with the same problems doesn't know js at all, but you would make our month if you could help us figure this out!:D

Thank you in advance!!!!!!


Well, hehe. Javascript:blahblahblah, might not be what you're looking for, because I think it will open a blank page with that, since it's being done by the AS, not the JS. What you want for AS is external interface. You have to import something, then do externalInterface.call("jsfunc","param1","param2"); and you can have as many parameters as you want. Although if you problem is only with IE, you could add an FSCommand because it only works in IE, but I forgot quite how you use it.

photoguy1601
07-05-2007, 04:18 PM
Hi,

This link

http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15683&sliceId=2#javascript

seems to be the answer. I haven't tried, though, as it looks very complicated. But I think we are on the right track. Any experts on this matter?

Charlene1
07-28-2007, 09:04 PM
http://www.dynamicdrive.com/forums/showthread.php?p=102045#post102045 - check it out! Medyman figured it out!!!