A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: lightbox flash integration

  1. #1
    Junior Member
    Join Date
    Jun 2010
    Posts
    2

    Question lightbox flash integration

    Hi guys,

    I want to load a lightbox gallery from within a flash .swf i no its possible because iv seen it done many times, and iv tried every tutorial on the net, most of which say the same thing, which I have done and it still doesnt work.

    So far I have created a javascript delegate which turns the flash command getURL into an anchor tag containing a rel="" attribute. Here is my javascript:

    Code:
    <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>
    I have then used a flash button to call the javascript function, in theory this should load my lightbox, however all that happens is the flash swf disappears and no lightbox overlay or image appears. I no that fksh objects do disappear when lightbox loads, however mine doesnt load. My ActionScipt on the flash button is as so:

    Actionscript Code:
    on (release)
     {getURL("javascript:LightboxDelegate('1.jpg','caption1')", "_self")
    }

    If anyone has any ideas what im doing wrong or if iv missed anything obvious I would really appreciate it!!

    Mike

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    This here works very well. You can also download an example:

    http://blog.codefidelity.com/?p=18


    good luck.

    gparis

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center