;

PDA

Click to See Complete Forum and Search --> : shadowbox, lightbox, javascript, help PLEASE...


fire_for_SiN
07-07-2008, 12:48 AM
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

eggler
07-07-2008, 11:47 PM
H ave a look at this: http://manewc.com/2008/03/14/as-3-calling-javascript-functions-without-fscommand/

Does that help?

fire_for_SiN
07-08-2008, 12:15 AM
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

eggler
07-08-2008, 12:36 AM
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.
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')

fire_for_SiN
07-08-2008, 01:13 AM
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.

eggler
07-08-2008, 01:19 AM
Ah... are you using Actionscript 3.0 there?

neznein9
07-08-2008, 01:31 AM
ExternalInterface.call('LightboxDelegate', 'http://www.everythingtonothing.com/assets/images/photography/light_house.jpg', 'light house');

fire_for_SiN
07-08-2008, 02:01 AM
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/

eggler
07-08-2008, 02:09 AM
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.

fire_for_SiN
07-08-2008, 09:21 AM
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.