-
Follower
CS4, AS2: Calling Lightbox from button
I'm working on a website www.designrd.com/ayla/
I am basically attempting to call up Lightbox 2 from the 'VIEW GALLERY' button in the swf as you can't make the whole swf a hyperlink..
The button has this code on it
Code:
on(release)
{
getURL("javascript:show('images/image1.jpg')");
}
and within the HTML I have this code
Code:
<a id="dummyanchor" href="" rel="lightbox"></a>
JAVASCRIPT:
function show(url) {
var a = document.getElementById('dummyanchor');
a.setAttribute('href',url);
myLightbox.start(a);
}
this was the best sounding solution I had found as given by 'under' on this page.
http://www.huddletogether.com/forum/...iscussionID=99
If there are an easier/other ways of doing this I am open to suggestion, I'm essentially trying to get a button within an SWF to call up Lightbox 2
-
Follower
UPDATE
http://drupal.org/node/324365
This has gotten me closer, it's opening up the lightbox but without any images...
Code:
<a href="" rel="lightbox" id="callfromflash"></a>
<script type="text/javascript">
function openLightbox() {
fireEvent(document.getElementById("callfromflash"),'click');
}
function fireEvent(obj,evt){
var fireOnThis = obj;
if( document.createEvent ) {
var evObj = document.createEvent('MouseEvents');
evObj.initEvent( evt, true, false );
fireOnThis.dispatchEvent(evObj);
} else if( document.createEventObject ) {
fireOnThis.fireEvent('on'+evt);
}
}
</script>
<a href="images/1.jpg" id="callfromflash" rel="lightbox" title="GALLERY"></a>
I have a feeling the problem is the last bit of code, not sure how that's supposed to work exactly
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|