alert This appears to be a flash file, you cannot see a preview because flash player is no longer supoorted in browsers, but you can still download the file to study it's source code.
You can open/play the swf file with Flash Player exe
user MBMedia
MBMedia (1)

AS3 Shadow Box

Loads Images or Swf files, automatically sets display sizes based on stage width and height, will always show above all content placed on stage, allows the user to download the item (optional when you call the shadow box) and can optionally show html description text. Full featured, and commercial use allowed except for flash stock.
8368 downloads, 73244 views

shadow box light shadowbox lightbox popup preview image swf oop darken window lightwindow shadowwindow


Download (3.09 MB)

Comments

You need to login to post a comment.

user ephrem
ephrem 15 years ago

How can i call a html/php page within this shadowbox? Please help me. Thanks in advance.

user adamcritchlow
adamcritchlow 15 years ago

works great, with one problem. the file that calls the shadowbox is resized using html in its div. When the frame with the code "plays" the flash file suddenly over takes the html and resizes to it original size (which is too large). Here is my AS3:
import local.display.ShadowBox;
ShadowBox.initialize(stage);



reelBTN.addEventListener(MouseEvent.CLI CK, btn1Click);
function btn1Click(event: MouseEvent) : void
{
ShadowBox.show("DannerReelPOPUP.swf");
}

stuntBTN.addEventListener(MouseEvent.MO USE_DOWN,stuntHandler);
function stuntHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("index1.html"), "_parent");
}

resumeBTN.addEventListener(MouseEvent.M OUSE_DOWN,resumeHandler);
function resumeHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("ResumeINDEX.html"), "_self");
}

prophoBTN.addEventListener(MouseEvent.M OUSE_DOWN,photoHandler);
function photoHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("ProdPhotosINDEX.html"), "_self");
}
vidBTN.addEventListener(MouseEvent.MOUS E_DOWN,vidHandler);
function vidHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("VideosIndex.html"), "_self");
}
newBTN.addEventListener(MouseEvent.MOUS E_DOWN,newsHandler);
function newsHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("newsINDEX.html"), "_self");
}
pressBTN.addEventListener(MouseEvent.MO USE_DOWN,pressHandler);
function pressHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("PressINDEX.html"), "_self");
}
conBTN.addEventListener(MouseEvent.MOUS E_DOWN,emailLink);
function emailLink(event:MouseEvent):void {
navigateToURL(new URLRequest("mailto:[email protected]"));
}

user Blooblood
Blooblood 15 years ago

MBMedia - sorry for such a late response (3 months!!). I had no success loading a SWF that had "off-stage animations" via ShadowBox. Other, more standard SWF were no problem. I got around the issue by using a UILoader and all works fine. Thanks for your response anyway.

Electrodoc - Keyfish contacted me directly and I believe this person is good to go. It was only a matter of the path to the images (as you correctly pointed out) but also incorrect Instance Names in the code.

user electrodoc
electrodoc 15 years ago

U probably did not include all all the as proper path to the files! usually if u use this kind of code u must manually add reference to the pics e.g (mouse.click, pic01)
pic01 shadowbox.show("pic01.jpg")

user Keyfish
Keyfish 15 years ago

If anyone can help me, I'd be extremely appreciative. I'm having a problem loading my images. I got the ShadowBox to work, but when I click on the button that should load the shadowbox image, it loads the shadowbox, but the image is a small white box with a loading icon in it.

I also get this error: Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

I adapted MBMedia's code used in preview.fla to my files, copied the local and pics folders into the same area as my .fla file, and put the correct directory into my script, but it still doesn't load the file.

Does anyone know how to fix this? I seem to be the only one that can't get this widget to work right, so I'm thinking it's something I'm not seeing.

user electrodoc
electrodoc 15 years ago

Very good gallery, but a bit slow on large image load

user MBMedia
the listing author MBMedia 15 years ago

BlooBlood: There is no such thing as invisible content as far as script is concerned (widths and heights read just the same). And there is also no such thing as a stage in any swf that is loaded into another swf (it just becomes a movieclip).

AS3 is designed to be self contained. So you have 100% control over your own swf that gets loaded in. The good part about that is that you can use other peoples scripts (like the one you downloaded here) and still have complete control over your own content. The difficult part about it is that writing a swf that is designed to be loaded requires its own knowledge and techniques.

For your swf being loaded, make it 2 frames. Make the first frame nothing but a fully transparent square that is the size you want the swf to seem. Then make it detect when itself is fully loaded, wait another second maybe, then go to your content that you want to show. Also, you'll want to mask that content at the proper size to.

These are general things you can use any time you make a swf that is designed to be loaded into another swf.

user rattes
rattes 15 years ago

Nice!

user Blooblood
Blooblood 15 years ago

Hello MBMedia,

Excellent script. Thank you very much! It works perfectly on all my photos and SWF files, however, I have a little problem when calling one SWF, which is an animation with a scrolling background. The background (street-scene) is ~4x wider than the stage. I've used a mask so that none of the off-stage images appear when the SWF runs. All is good. EXCEPT when ShadowBox calls it. Then, I have a huge blank, white area to the right of the action/stage. Totally weird that only ShadowBox "sees" some otherwise invisible content. Here's my code:

import local.display.ShadowBox;
ShadowBox.initialize(stage, 3, 25);

Is there some extra code I can insert to instruct ShadowBox to ONLY show the stage area of my SWF?

Thanks in advance.

user sitharam
sitharam 15 years ago

great script in that can you provide bottom on the image indecate the arrows left and right it will nice for slide show can do that

user sitharam
sitharam 15 years ago

nice work when we view swf file it is in left top cornor can you tell me how to fix the centre on screen

user jsan22
jsan22 15 years ago

such a nice work

user MBMedia
the listing author MBMedia 15 years ago

It will center the image on the screen like in the preview. Make sure you are using standard stage settings, like stage.align = "TL"; stage.scaleMode = "noScale";

user merc
merc 15 years ago

Hi. Nice work, thanks for sharing. Is there any way to move the alignment point of the swf files? Right now Shadowbox centers the upper left hand corner of the swf file in the center of the stage. Thanks in advance!

user mqluvly
mqluvly 15 years ago

Hi! Great work. Could you please tell me what's the script to put in a url link to the images. I'd like to use this lightbox for site designed portfolio's, rather than opening a _blank page. Thanks!

user zeda
zeda 15 years ago

Oh It's so nice

user badre
badre 15 years ago

nice gallery

user MBMedia
the listing author MBMedia 16 years ago

Flash 8 does not do AS3

user nancykapoor
nancykapoor 16 years ago

i ahve flash 8 professional!!
can u help me to open this file in dat

user nireve
nireve 16 years ago

Great job, thank you for sharing.

user MBMedia
the listing author MBMedia 16 years ago

When adobe made AS3 the intention was that a swf would be self reliant, could detect when it was removed from stage and stop it's own sound. See this for details of how to do that:

stackoverflow.com/questions/723169/how- does-one-stop-a-swf-movie-dynamically-lo aded-using-the-loader-class-using-act

user RatticSassin
RatticSassin 16 years ago

how do you let it play swfs so that when you exit out of them it will stop all a sounds?


user MBMedia
the listing author MBMedia 16 years ago

No problem, I'm glad you got it all working :) Enjoy!

user VALERA.
VALERA. 16 years ago

All works. All has understood.
Thank you very much.
Excuse!

user VALERA.
VALERA. 16 years ago

OPS.A help file HTML...Now I will look.

user VALERA.
VALERA. 16 years ago

I already have read all.
But has not found where it is told as to integrate a gallery code in flash a site (In my flash site).

user MBMedia
the listing author MBMedia 16 years ago

Read the documentation, it covers it thoroughly. It simply gets placed in the library of the flash file you want it it.

user VALERA.
VALERA. 16 years ago

Who knows as it is possible to insert it in a site?

user MBMedia
the listing author MBMedia 16 years ago

This doesn't do that, this does what the description and documentation says it does. If there is an arrow symbol in the .fla then it is just accidentally left in from something else.

user tjhanour
tjhanour 16 years ago

can anyone answer my question about the groups of images thing. Can you have a group of images come up in one box and scroll through them. It looks like an arrow symbol is included with this. Is that what it's for?

user MBMedia
the listing author MBMedia 16 years ago

@ timbash

Thanks, but all clickable buttons already use the hand cursor :)

user MBMedia
the listing author MBMedia 16 years ago

@ VALERA

There are very specific and thorough instructions in the help section about how to implement it, and that is not how.

user VALERA.
VALERA. 16 years ago

var ldr:Loader = new Loader();
var urlReq:URLRequest = new URLRequest("ShadowBox.swf");
ldr.load(urlReq);
--------------------
Does not work on such method.
As it to introduce in a site

user VALERA.
VALERA. 16 years ago

Excuse has not read the licence! :=)
Excuse has not read the licence!
Many thanks...

user VALERA.
VALERA. 16 years ago

YO!
I have not understood!
This TOTORIAL can be used on the site?

user GEEK420
GEEK420 16 years ago

Downloaded again....Works great! Very Very Nice! Good tip from Timbaah for the buttons! Thank you MBMedia.

user druidcreative
druidcreative 16 years ago

Bootiful

user timbaah
timbaah 16 years ago

Yoo, looks nice!
Add this to the buttons:

btnMC.buttonMode = true;
btnMC.useHandCursor = true;

It's always good to see the little hand!

user sambrown
sambrown 16 years ago

very nice work. super useful and nice to see an good implementation of oop.
@GEEK420 - try downloading the zip again? works fine for me.

user hamada_101
hamada_101 16 years ago

great work

user hesplue
hesplue 16 years ago

thanksssssssss

user rvvv
rvvv 16 years ago

Hi ,
U Great Work , i am also watinge this tipe of work , ty u sharing me , u are so greate work..........
Thanks for sharing,
rvv

user tjhanour
tjhanour 16 years ago

Hey MBMedia... This thing is Great!! Is there a way to use this like lightbox where the popup can hold a gallery (group) and scroll through the images? that would be great.

user GEEK420
GEEK420 16 years ago

Help Please!!
I can't extract this file.
"End-of-central-directory signature not found. Either this file is not a Zip file, or it constitutes one disk of a multi-part Zip file."
This is the error that Winzip throws off when I try to extract the file. I also get an error when using Winrar.

user joniex
joniex 16 years ago

nice work~! thx for sharing ^^

user FebFish
FebFish 16 years ago

Cool.
Thanks for sharing :D

user adrianTNT
adrianTNT (admin) 16 years ago

Hello, I edited the "edit listing" page, now the url option is available there. But stil it cannot contain links to competitive sites or affiliate links.

user MBMedia
the listing author MBMedia 16 years ago

The author url was to go to my Flashden profile page, that may be why it blocked it (though I really don't see that as any more advertisement than pointing you your own website, it really is the page I use as my home site). The link URL was to my own website with a file preview, but I always put project files in a subdomain that includes the word flashden so that might be why it blocked that. The blocking algorithm probably doesn't differentiate between a domain name and a subdomain name :)

user adrianTNT
adrianTNT (admin) 16 years ago

What is the author url you are trying to set? There are some links that are blocked.

user adrianTNT
adrianTNT (admin) 16 years ago

Hello.
I pointed that because when I checked the swf was not displayed, I moved the files and then it appeared.
About the other things you mentioned there might be some bugs, I will check.

user MBMedia
the listing author MBMedia 16 years ago

Though no matter how many times I change my author URL it doesn't change, and the listing URL didn't seem to take when I submitted, and I don't see an option for editing that when I click the Edit your listing button...

user MBMedia
the listing author MBMedia 16 years ago

Thank you for that adrianTNT, but I have no idea why you are pointing it out, since the zip submitted for preview does have the preview swf directly in the root of the zip file (named preview.swf), and the preview is showing up...

user adrianTNT
adrianTNT (admin) 16 years ago

"The zips can contain multiple files like XML files, images, directories but make sure your preview SWF file is directly in the root of the zip file, otherwise file preview will not show up."