Topic: Viewer loading at bottom right

Hi,

I was able to embed a single gallery viewer into a flash movie using the following code, that I got from this forum, where "test" is the name of my empty movie clip:

Stage.align = "C";
Stage.scaleMode = "noScale";

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

var myMovieClipLoader = new MovieClipLoader();
myMovieClipLoader.addListener(this);

function loadGallery(){

_root.xmlDataPath = "gallery.xml";
myMovieClipLoader.loadClip("viewer.swf",test);

}

However when I export my movie for a preview, my gallery is completely loaded to the bottom right, while my stage (scene 1) is in the center.

In my simpleviewer.fla file I set the stage to the same size as my movie (1100x600). The Stage.align is also set to "C" and in my options I'm using a fixed layout.
When I set the viewer to Stage.align = "TL" my movie stage (scene 1) would play at the top left (instead of center) and my viewer would this time be centered.

I have tried different combinations (fixed/ non-fixed layout, TL, C etc..) and I still wasn't able to center both my movie and the simple viewer pro.

It would be nice if someone could help me figure out a solution - I am sure that I'm just missing a very small detail !

Thank you smile

Re: Viewer loading at bottom right

SimpleViewer is designed to work with Stage.align = "TL". Switch both aligns to TL. Now you will need to center your flash main movieclip using code:

Stage.addListener(this);

private function onResize(){                
   //myMainMC is the name of your main movieclip that contains all your site elements. 
   myMainMC.x = (Stage.width - myMainMC.width)/2;
   myMainMC.y = (Stage.height - myMainMC.height)/2;
}
Felix Turner
SimpleViewer Support Team.

Re: Viewer loading at bottom right

Hi,

I've had the same problem as Chrys but still can't resolve it. I've set both Stage.align and Stage.scaleMode to "TL" in my original flash file. On my website flash, I've used the following code based on your last reply:

Stage.align = "TL";
Stage.scaleMode = "TL";

_global.AVStageWidth = 680;
_global.AVStageHeight = 443;


Stage.addListener(this);

private function onResize(){               
YPHOTO.x = (Stage.width - YPHOTO.width)/2;
YPHOTO.y = (Stage.height - YPHOTO.height)/2;
}


var galleryName:String;
var myMovieClipLoader = new MovieClipLoader();
myMovieClipLoader.addListener(this);

function loadGallery(theXML){

galleryName = theXML;
myMovieClipLoader.loadClip("autoviewer.swf",YPHOTO);

}

function onLoadInit(){   
  _root.xmlDataPath = galleryName;
}

loadGallery("gallery.xml");



When I try to preview, I get the following error message:

line 10: attribute outside class. (line 10 is the private function line)



Can you please help me? I've tried everything at this point and I'm convinced it must be something very simple I'm missing.

Thanks,

Mirna

Re: Viewer loading at bottom right

Hi,

try removing the word 'private'.

Felix Turner
SimpleViewer Support Team.

Re: Viewer loading at bottom right

It works now, but it's back in the bottom right hand corner...  Is there something I'm missing in either the original autoviewer code or in my flash website's code?

Thanks again,

Mirna

Re: Viewer loading at bottom right

Hi again,

I've solved the problem by moving my stage to the top right hand corner of my layout so it aligns where I'd like it to when previewed. Not the greatest solution but at least it works for now! I'll keep digging around to see if I can figure out why the script didn't work...

Cheers,

Mirna