Topic: change xml when toggleFullscreen

hi i'm using the flash embed version and currently have some movieclips displaying in normal display state and disappearing in fullscreen, is there a way to change the xml when fullscreen mode is toggled? so I can have a fixed layout for one and default for fullscreen?

I have pasted my as3 code below for ref

Thanks
Giles

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

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("xml/gallery/gallery.xml");

function loadGallery(url:String){
   
    galleryURL = url;
   
    //unload previous simpleviewer instance
    if (svAPI != null ) svAPI.dispose();
    svAPI = null;
    //flash 9 - unload
    if (swfLoaded) svLoader.unload();
    //Flash 10 - unloadAndStop
    //if (_viewerLoaded) svLoader.unloadAndStop();
           
    //load simpleviewer swf
    var urlReq:URLRequest = new URLRequest("system/gallery/simpleviewer-gallery.swf");
    svLoader.load(urlReq);
    swfLoaded = true;

    if (stage.hasOwnProperty("displayState")) { // check fullscreen feature is accessible or not
        stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullscreenHandler);
       
    }
}

function fullscreenHandler (e:FullScreenEvent) {
    if (e.fullScreen) {
   
    mcButton1.alpha=0;
    top_right_cnr_mc.alpha=0;
    btm_right_cnr_mc.alpha=0;
    top_left_cnr_mc.alpha=0;
    btm_left_cnr_mc.alpha=0;
   
    } else {

    mcButton1.alpha=1;
    top_right_cnr_mc.alpha=1;
    btm_right_cnr_mc.alpha=1;
    top_left_cnr_mc.alpha=1;
   
    btm_left_cnr_mc.alpha=1;
    }
}

function onViewerInit(e:Event):void{
    trace("onViewerInit");
   
    //listen for
    Object(svLoader.content).addEventListener("svComplete", onGalleryLoaded);
   
    trace("setViewerFlashVars");
    var options:Object = Object(svLoader.content).embedOptions;
    options.galleryURL = galleryURL;   
}
       
function onGalleryLoaded(e:Event):void{
   
    svAPI = Object(svLoader.content).api;
    svAPI.setSize(mcLoader.mcFrame.width,mcLoader.mcFrame.height);
}

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

function onResize(e:Event){   

    mcBkgnd.width = stage.stageWidth;
    mcBkgnd.height = stage.stageHeight;

    mcLoader.mcFrame.width = stage.stageWidth - mcLoader.x - 20;
    mcLoader.mcFrame.height = stage.stageHeight - mcLoader.y - 20;
   
    if (svAPI != null ) svAPI.setSize(mcLoader.mcFrame.width,mcLoader.mcFrame.height);
}

mcButton1.addEventListener(MouseEvent.CLICK,load360Tour);
mcButton1.buttonMode=true;

function  load360Tour(e:MouseEvent):void  { ExternalInterface.call( "loadVirtualTour" );
}

Re: change xml when toggleFullscreen

In your fullscreenHandler function, try loading galleries with different XML files for fullscreen and normal modes.
Try something like the following:

function fullscreenHandler (e:FullScreenEvent) {
    if (e.fullScreen) {
   
    mcButton1.alpha=0;
    top_right_cnr_mc.alpha=0;
    btm_right_cnr_mc.alpha=0;
    top_left_cnr_mc.alpha=0;
    btm_left_cnr_mc.alpha=0;

    loadGallery("xml/gallery/gallery2.xml");
   
    } else {

    mcButton1.alpha=1;
    top_right_cnr_mc.alpha=1;
    btm_right_cnr_mc.alpha=1;
    top_left_cnr_mc.alpha=1;
    btm_left_cnr_mc.alpha=1;

    loadGallery("xml/gallery/gallery.xml");

    }
}
Steven Speirs
SimpleViewer Support Team.

Re: change xml when toggleFullscreen

thanks I tried that before posting but i didnt work however I just had the wrong publish directory..it happens to us all. cheers