Topic: Modifying Embedded Flash Gallery Viewer

Ok, another noob question.. I managed to get my gallery up online:

http://www.benschellpfeffer.com/arcadia.swf

However, I haven't been able to integrate the gallery into the overall SWF governing the entire site. What I want is for when users click on the photos button on my home page:

http://www.benschellpfeffer.com

for the "arcadia gallery" to appear beneath the rest of the text on the page as if it were any other SWF object.  Here is the Flash CS3 Action Script 3 code:

this.createEmptyMovieClip("SWFHolder", this.getNextHighestDepth());

var mcLoader:MovieClipLoader = new MovieClipLoader();

photos_btn.onRelease = function ()
{
mcLoader.loadClip("arcadia.swf", SWFHolder);

SWFHolder._x = 0;
SWFHolder._y = 0;
}

bio_btn.onRelease = function ()
{
mcLoader.loadClip("bio.swf", SWFHolder);

SWFHolder._x = 0;
SWFHolder._y = 0;
}

contact_btn.onRelease = function ()
{
mcLoader.loadClip("contact.swf", SWFHolder);

SWFHolder._x = 0;
SWFHolder._y = 0;
}

clients_btn.onRelease = function ()
{
mcLoader.loadClip("clients.swf", SWFHolder);

SWFHolder._x = 0;
SWFHolder._y = 0;
}

shortfilms_btn.onRelease = function ()
{
mcLoader.loadClip("shortfilms.swf", SWFHolder);

SWFHolder._x = 0;
SWFHolder._y = 0;
}

photos_btn.onRelease = function ()
{
mcLoader.loadClip("photos.swf", SWFHolder);

SWFHolder._x = 0;
SWFHolder._y = 0;
}

features_btn.onRelease = function ()
{
mcLoader.loadClip("features.swf", SWFHolder);

SWFHolder._x = 0;
SWFHolder._y = 0;
}

I think my problem has something to do with the Actionscript Api coding? Do I need to integrate the svloader? If so how?

Thanks

Re: Modifying Embedded Flash Gallery Viewer

Did you take a look at the instructions for embedding SimpleViewer into flash?

Mike Richards
SimpleViewer Support Team.

Re: Modifying Embedded Flash Gallery Viewer

Hi Mike,

Yes, using those instructions I've made it this far. However, I reach and impass here:

SimpleViewer uses StageScaleMode.NO_SCALE and StageAlign.TOP_LEFT. Check the resize code in the example FLA to see how to handle resizing with these parameters set.

Here's the bit of code I think my issue points to:

//example resizing code
stage.addEventListener(Event.RESIZE,onResize);
onResize(null);

//called on stage resize
function onResize(e:Event){   
    //strecth bkgnd to match stage dimensions
    mcBkgnd.width = stage.stageWidth;
    mcBkgnd.height = stage.stageHeight;
   
    //resize mcFrame insude mcLoader
    mcLoader.mcFrame.width = stage.stageWidth - mcLoader.x - 20;
    mcLoader.mcFrame.height = stage.stageHeight - mcLoader.y - 20;
   
    //resize SV to match frame size
    if (svAPI != null ) svAPI.setSize(mcLoader.mcFrame.width,mcLoader.mcFrame.height);
   
}


However, I'm not sure why the viewer doesn't work as a standalone SWF once it's been created. Also, I'm wondering what the mcLoader - 20 does? Changing to a larger number seems to have no effect but removing the - make the example stop working.

Am I missing something?