A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: shadowbox, lightbox, javascript, help PLEASE...

  1. #1

    shadowbox, lightbox, javascript, help PLEASE...

    i am in dire need of help. i have been all around testing lightbox, videobox, mediabox, and now shadowbox.

    NO WHERE does it say how to implement shadowbox into flash. i have a button in my flash movie that when clicked, i would like it to be able to use shadowbox and open a flv or image.

    i need help creating the javascript for the button and the html holding my main swf movie.

    i have seriously tried every means and have no clue where to go from here. i would appreciate it ANY help fore this is driving me nuts.

    thank you,
    mike

  2. #2
    Senior Member
    Join Date
    Jan 2001
    Posts
    567
    H ave a look at this: http://manewc.com/2008/03/14/as-3-ca...out-fscommand/

    Does that help?

  3. #3
    i appreciate the help and that link you sent me does make some sense.

    the only thing is i am not that familiar with javascript. i can break down code given to me but i cannot seem to write it from scratch. so it would be helpful if you can or anyone help me get some sort of framework i can work off of.



    thank you,
    mike

  4. #4
    Senior Member
    Join Date
    Jan 2001
    Posts
    567
    Can you get the code working in your HTML page without the flash first? Once you've done that you need to find out how the javascript is called in the HTML. Lightbox automatically applies an onclick to all links that have a certain 'rel' attribute, so there's no clear call in the HTML, from memory.

    You can probably something like this in your actionscript.
    Code:
    ExternalInterface.call("Lightbox.start");
    But I'm not familiar with all those scripts you've listed. And I haven't played around with much javascripting + actionscripting.

    Also make sure your flash is embedded correctly if you need the lightbox to appear over the top of it. (ie wmode='transparent')

  5. #5
    okay, yes i have put a plain html href link on the page and it calls the shadowbox perfectly.

    the wmode is set to transparent as well.

    let me also confirm that i am using shadowbox, not lightbox. i believe shadowbox is based off of lightbox but plays videos and swfs unlike the strictly photo lightbox.

    what i need is some script on a button in flash that will send a URL to a photo or video to shadowbox in turn opens with that url in shadowbox.


    this is what lightbox uses and it works perfectly. but remember i am using SHADOWBOX which is similar but different scripting.

    this is put in the main html that has the swf embeded.

    <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>

    this is what goes on the button in flash.

    on (release) {
    getURL("javascript:LightboxDelegate('http://www.everythingtonothing.com/assets/images/photography/light_house.jpg','light house')");

    }

    see how it passes the url i need to lightbox.

    thank you all for your help.

  6. #6
    Senior Member
    Join Date
    Jan 2001
    Posts
    567
    Ah... are you using Actionscript 3.0 there?

  7. #7
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    ExternalInterface.call('LightboxDelegate', 'http://www.everythingtonothing.com/assets/images/photography/light_house.jpg', 'light house');

  8. #8
    eggler, no i am using 2.0 AS. should i be using 3.0?

    neznein9, i somewhate understand your comment but the thing is i am using shadowbox though. lightbox already has the javascript for flash and it works, i need SHADOWBOX to work. they are two different things. but you have given me some ideas i might try out.

    i need something that passes a url to SHADOWBOX so it will open that url. is anyone similar with shadowbox?

    http://mjijackson.com/shadowbox/

  9. #9
    Senior Member
    Join Date
    Jan 2001
    Posts
    567
    That link I sent you is all about the actionscript 3.0 solution and this is a 3.0 forum.

    And it makes a big difference. You'll need to use FSCommand in actionscript 2.0. If you google FSCommand + javascript there's plenty of examples out there.

    You'll need to have a look through the Shadowbox javascript to find out what the trigger/initailze function is if they do not provide an example.

  10. #10
    i do not know enough to figure the trigger function for shadwobox so that is a problem for me. i will continue to look around as i have been the past 2 weeks.

    but i appreciate your help.

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