Hi Steve,

I guess everything is working. I still have text stacking on top of each other when loading different galleries. I use a background image to cover it, so it doesn't bother me. Thank you for helping me. Actionscript is a tough nut if u begin from scratch.
Thanks again

greets from amsterdam
joost

for flash users using multiple galleries...this is my work around:

create frame labels on the timeline for each gallery. Create buttons to play the frame label

on the beginning of the frame label (of you're 1st gallery) create this AS code:

stop();

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

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;       

var svAPI:Object;
var swfLoaded:Boolean = false;
var galleryURL:String;
var svLoaderHome:Loader = new Loader();
var galleryShowing:Boolean = true;

mcLoader.addChild(svLoaderHome);
svLoaderHome.contentLoaderInfo.addEventListener(Event.INIT, onViewerInitHome);
loadGalleryHome("gallery/home/");

function loadGalleryHome(url:String){

    if (svAPI != null ) svAPI.dispose();
    svAPI = null;
    var urlReq:URLRequest = new URLRequest("simpleviewer.swf");
    svLoaderHome.load(urlReq);
    swfLoaded = true;
}

function onViewerInitHome(e:Event):void{
Object(svLoaderHome.content).addEventListener("svComplete", onGalleryLoadedHome);
var options:Object = Object(svLoaderHome.content).embedOptions;
options.baseURL = "gallery/home/";
}

function onGalleryLoadedHome(e:Event):void{
    mcLoader.mcFrame.width = 1204
    mcLoader.mcFrame.height = 667
    mcLoader.mcFrame.width = stage.stageWidth - mcLoader.x - 300;
    mcLoader.mcFrame.height = stage.stageHeight - mcLoader.y - 200;
    svAPI = Object(svLoaderHome.content).api;
    svAPI.setSize(mcLoader.mcFrame.width,mcLoader.mcFrame.height);
}

then on your the frame label of you're next gallery use:


stop();

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

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;       

var svLoader1:Loader = new Loader();

mcLoader.addChild(svLoader1);
svLoader1.contentLoaderInfo.addEventListener(Event.INIT, onViewerInit1);
loadGallery1("gallery/events/");

function loadGallery1(url:String){
    galleryURL = url;
    if (svAPI != null ) svAPI.dispose();
    svAPI = null;
    if (swfLoaded) svLoader1.unload();
    var urlReq:URLRequest = new URLRequest("simpleviewer.swf");
    svLoader1.load(urlReq);
    swfLoaded = true;
}

function onViewerInit1(e:Event):void{
Object(svLoader1.content).addEventListener("svComplete", onGalleryLoaded1);
var options:Object = Object(svLoader1.content).embedOptions;
options.baseURL = "gallery/events/";
}

function onGalleryLoaded1(e:Event):void{
    mcLoader.mcFrame.width = 1204
    mcLoader.mcFrame.height = 667
    mcLoader.mcFrame.width = stage.stageWidth - mcLoader.x - 300;
    mcLoader.mcFrame.height = stage.stageHeight - mcLoader.y - 290;
    svAPI = Object(svLoader1.content).api;
    svAPI.setSize(mcLoader.mcFrame.width,mcLoader.mcFrame.height);
}

and so on. Change the svLoader var and the functions on the different frame labels. Change you're resize code to the height and width of the mcLoader and mcFrame you loaded on the stage.
There is most likely a way to slim down this code, but it's a start.

good luck

well, I think I don't dispose or unload correctly. Otherwise when I load the next gallery, it would be a clean screen. Why would only the title text and thumbnail text stick?


stop();

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

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;       

var svAPI:Object;
var swfLoaded:Boolean = false;
var galleryURL:String;
var svLoader:Loader = new Loader();
var galleryShowing:Boolean = true;

mcLoader.addChild(svLoader);
svLoader.contentLoaderInfo.addEventListener(Event.INIT, onViewerInit);
loadGallery("gallery/trouwen/");


function loadGallery(url:String){
    galleryURL = url;
    if (svAPI != null ) svAPI.dispose();
    svAPI = null;
    if (swfLoaded) svLoader.unload();
    var urlReq:URLRequest = new URLRequest("simpleviewer.swf");
    svLoader.load(urlReq);
    swfLoaded = true;
}

function onViewerInit(e:Event):void{
Object(svLoader.content).addEventListener("svComplete", onGalleryLoaded);
var options:Object = Object(svLoader.content).embedOptions;
options.baseURL = "gallery/trouwen/";
}

function onGalleryLoaded(e:Event):void{
   
    mcLoader.mcFrame.width = 1204
    mcLoader.mcFrame.height = 667
    mcLoader.mcFrame.width = stage.stageWidth - mcLoader.x - 300;
    mcLoader.mcFrame.height = stage.stageHeight - mcLoader.y - 290;
    svAPI = Object(svLoader.content).api;
    svAPI.setSize(mcLoader.mcFrame.width,mcLoader.mcFrame.height);
   
}

next gallery


stop();

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

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;       


var swfLoaded1:Boolean = false;
var galleryURL1:String;
var svLoader1:Loader = new Loader();
var galleryShowing1:Boolean = true;

mcLoader.addChild(svLoader1);
svLoader1.contentLoaderInfo.addEventListener(Event.INIT, onViewerInit1);
loadGallery1("gallery/events/");

function loadGallery1(url:String){
    galleryURL = url;
    if (svAPI != null ) svAPI.dispose();
    svAPI = null;
    if (swfLoaded1) svLoader1.unload();
    var urlReq:URLRequest = new URLRequest("simpleviewer.swf");
    svLoader1.load(urlReq);
    swfLoaded1 = true;
}

function onViewerInit1(e:Event):void{
Object(svLoader1.content).addEventListener("svComplete", onGalleryLoaded1);
var options:Object = Object(svLoader1.content).embedOptions;
options.baseURL = "gallery/events/";
}

function onGalleryLoaded1(e:Event):void{
    mcLoader.mcFrame.width = 1204
    mcLoader.mcFrame.height = 667
    mcLoader.mcFrame.width = stage.stageWidth - mcLoader.x - 300;
    mcLoader.mcFrame.height = stage.stageHeight - mcLoader.y - 290;
    svAPI = Object(svLoader1.content).api;
    svAPI.setSize(mcLoader.mcFrame.width,mcLoader.mcFrame.height);
}

and so on.

I've tried the backgroundColor and the backURL, both don't work.

thnx
Joost

sorry, I got things to work in the meanwhile. so edited my last post....

Hi Steve,


I'm very frustrated at this moment!! I spent so much time only getting simple viewer to work. With your help I'm almost there. I finally get the galleries to work in all the locations of the timeline. The only thing is that when I go from one gallery to another, the title text and thumbnail numbers won't go away. So after a couple of clicks, all the title text is on top of each other.
Any suggestions?

greets,
Joost

Steve,

Thnx so much. If you just take a look. I know you are not a flash help desk ....! Just wanna get my site started.
project can be found here: [Link removed.]

let me know when u downloaded it, then I'll remove the link.

Cheers!
joost

this is the code for one gallery:


stop();

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

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;       

var svAPI:Object;
var swfLoaded:Boolean = false;
var galleryURL:String;
var svLoader:Loader = new Loader();
var galleryShowing:Boolean = true;

mcLoader.addChild(svLoader);
svLoader.contentLoaderInfo.addEventListener(Event.INIT, onViewerInit);
loadGallery("gallery/trouwen/");

function loadGallery(url:String){
    galleryURL = url;
    if (svAPI != null ) svAPI.dispose();
    svAPI = null;
    if (swfLoaded) svLoader.unload();
    var urlReq:URLRequest = new URLRequest("gallery/trouwen/svcore/swf/trouwen.swf");
    svLoader.load(urlReq);
    swfLoaded = true;
}

function onViewerInit(e:Event):void{
Object(svLoader.content).addEventListener("svComplete", onGalleryLoaded);
var options:Object = Object(svLoader.content).embedOptions;
options.baseURL = "gallery/trouwen/";
}

function onGalleryLoaded(e:Event):void{
    mcLoader.mcFrame.width = 1204
    mcLoader.mcFrame.height = 667
    svAPI = Object(svLoader.content).api;
    svAPI.setSize(mcLoader.mcFrame.width,mcLoader.mcFrame.height);
}

stage.addEventListener(Event.RESIZE,onResize);
onResize(null);

function onResize(e:Event){   
    mcBackground.width = stage.stageWidth;
    mcBackground.height = stage.stageHeight;
    mcLoader.mcFrame.width = stage.stageWidth - mcLoader.x - 0;
    mcLoader.mcFrame.height = stage.stageHeight - mcLoader.y - 0;
    if (svAPI != null ) svAPI.setSize(mcLoader.mcFrame.width,mcLoader.mcFrame.height);
   
}

for the second gallery:

stop();

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

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;       

var svAPI1:Object;
var swfLoaded1:Boolean = false;
var galleryURL1:String;
var svLoader1:Loader = new Loader();
var galleryShowing1:Boolean = true;

mcLoader.addChild(svLoader1);
svLoader1.contentLoaderInfo.addEventListener(Event.INIT, onViewerInit1);
loadGallery1("gallery/events/");

function loadGallery1(url:String){
    galleryURL = url;
    if (svAPI1 != null ) svAPI1.dispose();
    svAPI1 = null;
    if (swfLoaded1) svLoader1.unload();
    var urlReq:URLRequest = new URLRequest("gallery/events/svcore/swf/events.swf");
    svLoader1.load(urlReq);
    swfLoaded1 = true;
}

function onViewerInit1(e:Event):void{
Object(svLoader1.content).addEventListener("svComplete", onGalleryLoaded1);
var options:Object = Object(svLoader1.content).embedOptions;
options.baseURL = "gallery/events/";
}

function onGalleryLoaded1(e:Event):void{
    mcLoader.mcFrame.width = 1204
    mcLoader.mcFrame.height = 667
    svAPI1 = Object(svLoader1.content).api;
    svAPI1.setSize(mcLoader.mcFrame.width,mcLoader.mcFrame.height);
}

stage.addEventListener(Event.RESIZE,onResize);
onResize(null);

function onResize1(e:Event){   
    mcBackground.width = stage.stageWidth;
    mcBackground.height = stage.stageHeight;
    mcLoader.mcFrame.width = stage.stageWidth - mcLoader.x - 0;
    mcLoader.mcFrame.height = stage.stageHeight - mcLoader.y - 0;
    if (svAPI1 != null ) svAPI1.setSize(mcLoader.mcFrame.width,mcLoader.mcFrame.height);
   
}

the second gallery doesn't unload, I can't find why.

Hi Steve,

Got one gallery going perfect now! By copying the code to all the frames where I want my galleries I have to give all variables and functions unique names right? Isn't there a simpler way to work around giving all functions unique names? can't I use a function multiple times?

thanks
Joost

Hi Steve,

I picked up my website this week. So I picked up where we left off. I've been digging through some action script lately. What I haven't found out is why when my gallery is loaded, there is something on the stage that blocks my buttons (a few buttons work). There is one button that works and brings my to a different section of the main timeline. But the gallery I loaded is still there. Do I need to unload? Also when I test movie, the mcLoader is way bigger than intended.

How do I set the size for the mcLoader and mcFrame?
I have my own navigation set up, do I need the API pallet?

Sorry for my inability to solve this. It's complicated.

thanks

Hi steve,

I uploaded the file to http://www.megaupload.com/?d=HBIQ0VRG

thnx in advance

Sure! where do i upload my .fla file to?

thnx

Hi Steve,

The baseURL worked! perfect!!
Also I worked around centering my gallery (I think) with the following code.

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;

stage.addEventListener(Event.RESIZE,onResize);
onResize(null);

var svAPI:Object;
var svLoader:Loader = new Loader();
addChild(svLoader);
svLoader.contentLoaderInfo.addEventListener(Event.INIT, onViewerInit);
svLoader.load(new URLRequest("gallery/abstract/svcore/swf/abstract.swf"));

function onViewerInit(e:Event):void{
Object(svLoader.content).addEventListener("svComplete", onGalleryLoaded);
var options:Object = Object(svLoader.content).embedOptions;
options.baseURL = "gallery/abstract/";
}


function onGalleryLoaded(e:Event):void{
   
    svAPI = Object(svLoader.content).api;
    svAPI.setSize(mcLoader.mcFrame.width,mcLoader.mcFrame.height);
}

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

1: when testing the movie, when I enter the gallery, everything else goes out of order. It's like the gallery is on top of everything.

2: this code only works on one gallery. When I try to copy this code and paste (change the URLrequest and the baseURL to the other gallery) it to another frame where another galleries starts, it doesn't work. I get the following warnings:

conflict exists with definition svAPI in namespace internal
conflict exists with definition svLoader in namespace internal
duplicate function definition
duplicate function definition
duplicate function definition

Hi Steve,

I've tried editing the XML files and got it to work. I have many galleries and lot's of images which I have to update regularly. so each time I add a photo to a gallery with svbuilder it will re-write the xml and I will have to edit all over again. I loved it when using iWeb cause it was fully automated. Now it's a bit time consuming editing all the XML files. Am I missing a easier method (you know how we love it easy!)?

As Im new 2 action script, I still don't understand how to position my galleries (center on stage). Is there a tutorial on this somewhere?

thanks!

Hi Steve,

I'm new to all this so, sorry for the confusing story. By container movie, u mean my main .fla file right?
I understand the relative paths. In the main folder I have 8 separate gallery folders each containing the .xml, .html, .swf, an images folder, a thumbs folder. When saving a gallery with svBuilder it automatically makes a main folder (which i can give a name) an image/thumbs folder with the imageURL and thumbURL relative to the .xml or .html file right? So I can only have 1 images and thumbs folder. So would the solution be to copy all of the images into one "images folder" where the container movie is located? Or do I change the URL's in the gallery folders of each gallery? Or is my AS code incorrect?

this is what the folder looks like:
main folder/main.fla
main folder/main.swf
main folder/galleries/trouwen
main folder/galleries/trouwen/gallery.xml
main folder/galleries/trouwen/trouwen.html
main folder/galleries/trouwen/simpelviewer.swf
main folder/galleries/trouwen/images
main folder/galleries/trouwen/thumbs
main folder/galleries/amsterdam/gallery.xml
main folder/galleries/amsterdam/amsterdam.html
main folder/galleries/amsterdam/simpelviewer.swf
main folder/galleries/amsterdam/images
main folder/galleries/amsterdam/thumbs
etc..


Does it matter where I put the StageScaleMode.NO_SCALE and StageAlign.TOP_LEFT in action script?

thank a lot!
greets
joost

dear pro's,

Im building a multiple gallery flash site at the moment (my old iWeb site www.joostweddepohl.nl got lost so thought i'd rebuild in flash). On the timeline I labeled my gallery sections. This is the AS I used.

var svAPI:Object;
var svLoader:Loader = new Loader();
addChild(svLoader);
svLoader.contentLoaderInfo.addEventListener(Event.INIT, onViewerInit);
svLoader.load(new URLRequest("gallery/trouwen/svcore/swf/simpleviewer.swf"));

function onViewerInit(e:Event):void{
Object(svLoader.content).addEventListener("svComplete", onGalleryLoaded);
var options:Object = Object(svLoader.content).embedOptions;
options.galleryURL = "gallery/trouwen/gallery.xml";
}

function onGalleryLoaded(e:Event):void{
svAPI = Object(svLoader.content).api;
svAPI.setSize(1200,600);
}



Now..I get grey crosses where the thumbs and pics supposed to be. I made separate folders for all the galleries and traced to the folder (svLoader.load(new URLRequest("gallery/trouwen/svcore/swf/simpleviewer.swf")). It gave the following message:

[SV] Image Load Error for URL: images/IMG_1578.JPG
[SV] Thumb Load Error for: thumbs/IMG_1578.JPG attempting to load main image as thumb
etc..

What did i do wrong?   :o

Also how can I give exact coordinates for the gallery so it'l fit on in my frame?

thnx in advance
joost

My goodness....problem solved. Forgot to upload my gallery through the ftp server.

thnx again

Steve,

Thnx for your quick help.
I don't have an mobileMe account. I have my own ftp server. I published the site first to a local folder on the HDD. I put all the saved gallery files there. The page I want my gallery in is located in the folder: /User/joostweddepohl/Sites/www.joostweddepohl.nl/vrij_werk_files. So which URL do I type in?

Or do I have to upload a saved galley to an online server first (so I get the URL). and how do I do that?

Sorry, but I'm new to all this

greetings

Hi there,
I've been trying to embed with the code and i've tried iframe. I can't get it to work. this what i get on the page where I want the gallery:

Not Found
The requested URL /Users/joostweddepohl/Sites/www.joostweddepohl.nl/vrij_werk_files/vrij.html was not found on this server.

this is the iframe code:
<iframe src="/Users/joostweddepohl/Sites/www.joostweddepohl.nl/vrij_werk_files/vrij.html" width="800" height="600" frameborder="0" scrolling="no"></iframe>

please help?

Hi there,

I've been trying to embed with the code and i've tried iframe. I can't get it to work. this what i get on the page where I want the gallery:

Not Found

The requested URL /Users/joostweddepohl/Sites/www.joostweddepohl.nl/vrij_werk_files/vrij.html was not found on this server.
www.joostweddepohl.nl

this is the iframe code:

<iframe src="/Users/joostweddepohl/Sites/www.joostweddepohl.nl/vrij_werk_files/vrij.html" width="800" height="600" frameborder="0" scrolling="no"></iframe>

please help?