Topic: UNLOADING AUTOVIEWER from other swf

Hi, again a issue with Autoviewer and other SWF.

I have a Main FLASH movie from which i want to call different autoviewer galleries using buttons.

I kacked the code so i can target diffrent galleries (viewer1, viewer2...).
I load (NOT simultaneously) each gallery in a movieclip whithin the main flash

PROBLEM:
When I try to load onother gallery (ex I want to swich from gallery1 to gallery2) it keeps loading the first one I loaded.

If the first gallery i load is the third then no matter what button i press (1 or 2 or 4) it keeps loading the THIRD gallery.

wanna see the problem in action? www.thetreehouse.it

GUYS I NEED HELP!!!
Thanks[/u]

Re: UNLOADING AUTOVIEWER from other swf

I think you want your code something like this in your movie that loads the autoviewer swf:

//Set button actions
mcGal1.onRelease = function(){
    loadGallery("gallery1.xml");   
}

mcGal2.onRelease = function(){
    loadGallery("gallery2.xml");       
}

function loadGallery(galName){
    _root.xmlDataPath = galName;  
    mcLoader.loadMovie("viewer.swf");
}

//load first gallery
loadGallery("gallery1.xml");

Then you will need to modify the autoviewer code to allow switching the xmlDataPath. In the XML class, modify the function loadXML() to be:

public function loadXML():Void{            
        var xmlPath = Options.XMLPath;                
        if (_root.xmlDataPath != undefined) xmlPath = _root.xmlDataPath;
        xmlResults.load(xmlPath);                
    }    
Felix Turner
SimpleViewer Support Team.

Re: UNLOADING AUTOVIEWER from other swf

Hey FELIX THANKS A LOT!!! It works just GREAT!!! I was trying to solve this problem for over two weeks!!!

Still I have a question/problem:

a- I have four different galleries and each one is in a different image folder (images1, images2...) because i'm using build_gallerydata.php to speed up and optimize the gallery creation (being a photographer i update my galleris quite often).

Can I do it or I MUST put all the pictures in just one folder?

Again thanks a lot!!!
Pier

Re: UNLOADING AUTOVIEWER from other swf

After missing this thread on multiple searches i found the code and it worked apart from the same issue of images in folders. I would rather link to them through my swf rather than change the xml path.

Any help would be much appreciated.

Re: UNLOADING AUTOVIEWER from other swf

Felix wrote:

I think you want your code something like this in your movie that loads the autoviewer swf:

//Set button actions
mcGal1.onRelease = function(){
    loadGallery("gallery1.xml");   
}

mcGal2.onRelease = function(){
    loadGallery("gallery2.xml");       
}

function loadGallery(galName){
    _root.xmlDataPath = galName;  
    mcLoader.loadMovie("viewer.swf");
}

//load first gallery
loadGallery("gallery1.xml");

--------------------------------------

My problem is that this line doesn't work: 
mcLoader.loadMovie("viewer.swf");
This however works fine: _root.loadMovie("viewer.swf");

So there must be something with a path that viewer.swf uses in it's scripts.
Or am I missing something?

Maybe you are using Autoviewer PRO?

Posts [ 5 ]

Pages 1

You must login or register to post a reply