Topic: SimpleViewer embedded within Flash does not load button bar

I have laid out a gallery with the svbuilder-pro app, and then have loaded this gallery within a Flash movie.  The button bar does not appear, and the caption is not displayed at the height I have set.  Is there anything special I need to do in order to have these attributes loaded by Flash?

Re: SimpleViewer embedded within Flash does not load button bar

Did you follow the directions for embedding SimpleViewer into flash?

Mike Richards
SimpleViewer Support Team.

Re: SimpleViewer embedded within Flash does not load button bar

Yes this is the code I am using:

import flash.display.*;
import flash.net.URLRequest; 



var svAPI:Object; //svAPI is the object to call API methods on
var svLoader:Loader = new Loader();
addChild(svLoader);
svLoader.contentLoaderInfo.addEventListener(Event.INIT, onViewerInit);
svLoader.load(new URLRequest("simpleviewer.swf"));

/**
* Fired when preloader is available
* Can set gallery flashvars at this point
*/
function onViewerInit(e:Event):void{
Object(svLoader.content).addEventListener("svComplete", onGalleryLoaded);
var options:Object = Object(svLoader.content).embedOptions;

// The gallery is set on the main timeline.
if(MovieClip(root).gallery == null){
    var gallery = "gallery.xml";
}else{
    gallery = MovieClip(root).gallery;
}

options.galleryURL = gallery;

}

/**
* Fired when gallery has completely loaded. API is now available.
*/
function onGalleryLoaded(e:Event):void{
svAPI = Object(svLoader.content).api;
svAPI.setSize(1024,708);
var options = Object(svLoader.content).embedOptions;
for(var option in options){
    trace("options[",option,"]:", options[option]);
}

}

It loads fine, but the only option listed is the gallery URL.

Edit: and here is the XML:

<?xml version="1.0" encoding="utf-8"?>

<simpleviewergallery maxImageWidth="680"
maxImageHeight="600"
imageQuality="80"
thumbWidth="75"
thumbHeight="75"
thumbQuality="90"
useFlickr=""
resizeOnImport="1"
cropToFit=""
galleryWidth="1024"
galleryHeight="708"
backgroundTransparent="1"
galleryStyle="MODERN"
frameWidth="0"
thumbPosition="RIGHT"
thumbRows="7"
thumbColumns="3"
showOpenButton=""
showFullscreenButton=""
enableAPI="1"
thumbHoverFrameWidth="2"
thumbClickShift="0"
showNavButtons="1"
buttonBarPadding="0"
floatButtonBar=""
buttonBarHAlign="LEFT"
showAudioButton=""
showAutoPlayButton=""
titlePosition="TOP"
floatTitle=""
showBackButton=""
useFixedLayout="1"
imageAreaX="0"
imageAreaY="0"
imageAreaWidth="720"
imageAreaHeight="708"
thumbAreaX="780"
thumbAreaY="100"
captionX="780"
captionY="15"
titleX="0"
titleY="0"
buttonBarX="670"
buttonBarY="0"
imageScaleMode="SCALE_UP"
doThumbPopOut=""
thumbHAlign="RIGHT"
thumbVAlign="TOP"
showImageNav="NEVER"
showOverlay="NEVER"
 >

<image imageURL="images/tall.jpg"
thumbURL="thumbs/tall.jpg"
><caption><![CDATA[Example caption]]></caption></image><image imageURL="images/wide.jpg"
thumbURL="thumbs/wide.jpg"
><caption><![CDATA[Example caption (wide photo)]]></caption></image>
</simpleviewergallery>

Last edited by ray (2010-12-01 18:32:32)

Re: SimpleViewer embedded within Flash does not load button bar

Ok, looking at the XML I just gave you I see the problem.  I had code generating the XML and it stripped out any "true" or "false".