Topic: Trying to impliment into existing swf site

I'm trying to add the plain gallery from the 'web' directory into an existing swf site, however I'm having problems.

I've followed the example in the multiples gallery example with no luck, i'm getting alot of errors.

My code is as such:

//Set button actions
on(release) function(){
    loadGallery("gallery.xml");   
}

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

But I get some errors when attempting to publish:

**Error** Symbol=text buttons, layer=Layer 1, frame=1:Line 2: '{' expected
     on (release) = function(){

**Error** Symbol=text buttons, layer=Layer 1, frame=1:Line 6: Statement must appear within on handler
     function loadGallery(galName){

Total ActionScript Errors: 2      Reported Errors: 2

Any help would be greatly appreciationed.

thanks.

Re: Trying to impliment into existing swf site

Your syntax is wrong for for the function definition. Try using the code that is included in the example.

Felix Turner
SimpleViewer Support Team.

Re: Trying to impliment into existing swf site

That's the problem, I can't use the exact code since I'm adding only a single swf to another swf.  Its not exactly the same.  It should be easy for an experienced actionscript programmer to fix.

Re: Trying to impliment into existing swf site

I'm publishing to flash 6 due to the site I'm working with, but I've made some progress and just need a little help.

So far I have it loading the gallery within another main.swf on my local machine which works.  However, as soon as I push that to the host it can't find the gallery.

Its just a path issue but I don't know how to fix it.  Below is my code:

_global.SVStageWidth = 640;
_global.SVStageHeight = 420;

test.onRelease = function(){
    loadGallery("gallery.xml");       
}

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

The main.swf gets loaded from an index.html page thats one directory above.

My directory structure looks like this:

+Flash
index.htm
myCSS.css

Within the 'Flash' directory I have:

+images
+thumbs
main.swf
viewer.swf
gallery.xml
swfobject.js

The gallery is then loaded into the main.swf.  I don't know why it can't see that gallery.

thanks.

Re: Trying to impliment into existing swf site

bump

Re: Trying to impliment into existing swf site

This is what I was afraid of when purchasing the pro version.  Lack of support.

Re: Trying to impliment into existing swf site

try switch this:

mcLoader.loadMovie("viewer.swf"); 

to this

mcLoader.loadMovie("Flash/viewer.swf"); 
Felix Turner
SimpleViewer Support Team.

Re: Trying to impliment into existing swf site

Thanks Felix, I'll give it a try and let you know what happens.

Re: Trying to impliment into existing swf site

Ok, i made the change.  I also had to make the same addition to the gallery.xml file as well, and edit the xml files for the thumbnail and image paths. 

That's what was confusing me, the index.html file has the path for the main.swf which loads the viewer.swf;  I don't get why I need to add the Flash directory to the path if the index.html already loads the main.swf which has the viewer.swf in the same location.

The gallery now works, sort of.

When my main.swf loads, I click the button which loads the gallery.  First time through it works great.  However, if I go to a different page in the main.swf then return to the page that has the button to view the gallery and click it again, the gallery only loads the large image and the first thumbnail image.  The other images don't load; if I click on one of them the progress bar shows up in place of the large image, but it isn't moving.

Any ideas?

Re: Trying to impliment into existing swf site

This must have to do with the way the viewer.swf is created, I would think.  Why else are the images in the xml file not loading on essencially is a restart of the simpleviewer?

Re: Trying to impliment into existing swf site

Ok, I have found another user that had the same problem and they seem to have solved it with unloadmovie.  I don't know where to put the code for it.  I need some help please.


http://www.airtightinteractive.com/foru … ght=unload

Re: Trying to impliment into existing swf site

Why am I not getting a response to this??

Re: Trying to impliment into existing swf site

bump

Re: Trying to impliment into existing swf site

Felix, I need a response to this and your the expert.

Re: Trying to impliment into existing swf site

Hi,

Can you re-state exactly what the problem is you are seeing? If you are trying to embed a SV gallery in a flash site, you can use the example file in the SV-PRO download (examplesFlash Embedmultiple_galleries.fla).

Felix Turner
SimpleViewer Support Team.

Re: Trying to impliment into existing swf site

Hi,

Yes, that's exactly what I'm doing is incorporating a SV flash gallery into an existing flash site.  I have used the example code that you mentioned, and I have the SV gallery loading within the main site.  That part works, the gallery loads and it operates the same as the example.  (same code, layers, and setup)

The problem is that when the gallery is loaded and the user clicks on any other part of the main flash site, (eg. click a button and goto a different page/movieclip) and they then go back to the SV gallery it stops functioning correctly. 

Only the first thumbnail image and large image load, the rest do not. 

Upon looking at the output log in testing the movie, when the SV gallery loads the first time it shows the XML loading correctly and all the paths are there for each image.  When a different area of the main flash site is clicked and you then return to the SV gallery; the XML output log shows only 2 of the xml paths loading.  One for the first thumbnail, and one for the large image, the rest of the xml urls are not even shown. 

I really need this corrected.  I've tried everything I can think of and still no luck.  I've tried to unload the movie, I've tried locking the root of the SV gallery, and still nothing works.

Please help! 

thanks for the response.

Re: Trying to impliment into existing swf site

I solved the problem myself.  The SV is created in flash 7, where as the swf that I was introducing it into was created in flash 6.  So when republishing the main.swf the SV gallery was failing because the code base was wrong.