Topic: Embedding Content INSIDE of SimpleViewer v1.9

I'm working with SimpleViewer v1.9

I love SimpleViewer, but I've also been seeing something else of interest as well on a lot of sites lately (Shadowbox). When you click on an image on the page...a dynamic viewer opens inside of the window you're viewing and shows a more blown up version of the image selected. Everything else darkens to accommodate this new dynamic viewer as well.

Now I'm aware that you can embed SimpleViewer inside of other Flash/HTML content. But can you embed something like Shadowbox INSIDE of SimpleViewer itself (Free or Pro), or is that beyond it's capabilities?

If this kind of functionality CAN be added to SimpleViewer, and any of you (or the Mod) knows how...please let me know.

Last edited by TheRQTekt (2010-02-20 16:50:07)

Re: Embedding Content INSIDE of SimpleViewer v1.9

Do you mean being able to click on the main image and have it open in a shadowbox? Check out this post on how to add a Hyperlink to the main image of simpleviewer, but instead of calling a link use external interface to call the shadowbox

Mike Richards
SimpleViewer Support Team.

Re: Embedding Content INSIDE of SimpleViewer v1.9

miker wrote:

Do you mean being able to click on the main image and have it open in a shadowbox? Check out this post on how to add a Hyperlink to the main image of simpleviewer, but instead of calling a link use external interface to call the shadowbox


Yeah..I'll try...but I failed Java three semesters in a row, so we'll see how this goes. I'm hand coding a flash site right now.

Do you think that SimpleViewer might gain this functionality with future releases? This would definitely be a killer feature if the two technologies combined.

Re: Embedding Content INSIDE of SimpleViewer v1.9

After you follow the Hyperlinking Main Images (SOLUTION) post just modify:
   

public function openImageLink(){
        getURL(mXMLManager.imagePath + mXMLManager.imageFileNames[mCurrentImageIndex],"_blank");    
    }

Either use the example from the shadowbox faq: How can I open Shadowbox from inside a Flash movie? or you can try what I used on my page (below).

At the top of ImageArea.as add:

import flash.external.ExternalInterface;

Replace the openImageLink function from Hyperlinking Main Images (SOLUTION)

    public function openImageLink(){
        var popupWidth = mImages[mCurrentImageIndex].imageWidth;
        var popupHeight = mImages[mCurrentImageIndex].imageHeight;
        ExternalInterface.call('theShadowBox','img',mXMLManager.title,mXMLManager.imagePath+mXMLManager.imageFileNames[mCurrentImageIndex],popupHeight,popupWidth);
    }
    

In my html this is the javascript that called shadowbox.   

    <script type='text/javascript'>
        //<![CDATA[
            Shadowbox.path = '/shadowbox/';
            Shadowbox.init({
                resizeLgImages:     false, loadingImage: '/img/loading.gif',
                handleUnsupported:  'remove', keysClose:          ['c', 27], // c or esc
                flashParams:        {bgcolor:"#FFFFFF"}, handleOversize: 'resize',
                players:              ['iframe', 'img']
            });

            function theShadowBox(type, title, imageURL, height, width){
                var h = height; //+ 89;
                var w = width; //+ 18;
                Shadowbox.open({player: type, content: imageURL, height: h, width: w});
            };
        //]]>
        </script>
Mike Richards
SimpleViewer Support Team.