Load embeded panotour swf into another flash movie  

This forum is fully dedicated to Panotour / Panotour Pro bug reports as well as feature discussion.
no avatar
ivanov014
New member
 
Posts: 2
Joined: Mon Aug 06, 2012 9:21 pm

Load embeded panotour swf into another flash movie

by ivanov014 » Mon Aug 06, 2012 9:41 pm

Hi

how do we load an (embeded) pano virtual tour in another swf flash file.

So far we haven't been able to use any as3 swf loading codes to get this working.

i even tried the following krpano embedding into Flash CS example ..no luck

Do you have any sample fla to provide for that purpose.

Thanks




Code: Select all
/*
    krpano embedding into Flash CS example
*/

var krpano:Object = null;


function krpano_load():void
{
    var krpanoloader = new Loader();
    krpanoloader.contentLoaderInfo.addEventListener(Event.COMPLETE, krpano_load_complete);
    krpanoloader.load(new URLRequest("myembeded_pano.swf"));
}

function krpano_load_complete(event:Event):void
{
    (event.target.content as Object).embeddedstartup(stage, krpano_ready);
}


// start
krpano_load();


function krpano_ready(krpanointerface:Object):void
{
    krpano = krpanointerface;
   
    // open the krpano log and show a message:
    krpano.call("showlog(true);");
    krpano.set("debugmode", true); // show 0/debug traces
    krpano.trace(0,"ready...");
   

    // load a inline xml with a preview image as demo
    krpano.call("loadxml('<preview type=\"grid(cube);\" />');");
   
    // example: load a pano xml:
    //krpano.call("loadpano(pano.xml,null,MERGE,BLEND(1));");
   
   
    // get notified about krpano resize events
    krpano.set("events.onresize", krpano_resize_event);
   
   
    // change the pano area to a fixed size:
    var area:Object = krpano.get("area");
    area.x      = 20;
    area.y      = 20;
    area.width  = 400;
    area.height = 300;
   
       
    // examples how to add/change plugins from as3:
   
    // 1. the "set-interface" way:
    krpano.call("addplugin(button1);");
    krpano.set("plugin[button1].url", "button.jpg");
    krpano.set("plugin[button1].parent", "STAGE");
    krpano.set("plugin[button1].align", "righttop");
    krpano.set("plugin[button1].x", 10);
    krpano.set("plugin[button1].y", 10);
    krpano.set("plugin[button1].onhover", "showtext(toggle pano layer);");
    krpano.set("plugin[button1].onclick", toggle_krpano_visibilty);
   
    // 2. the direct object way (faster)
    krpano.call("addplugin(button2);");
    var button2:Object = krpano.get("plugin[button2]");
    button2.url     = "button.jpg";
    button2.parent  = "STAGE";
    button2.align   = "righttop";
    button2.x       = 10;
    button2.y       = 50;
    button2.onhover = "showtext(change area size);";
    button2.onclick = toggle_krpano_area;
}


function krpano_resize_event():void
{
    var area:Object = krpano.get("area");
   
    krpano.trace(0,"pano resize - pos=" + area.pixelx + "," + area.pixely + " size=" + area.pixelwidth + "x" + area.pixelheight);
}


function toggle_krpano_visibilty():void
{
    var imagelayer:Sprite = krpano.get("image.layer");
   
    if (imagelayer.visible == true)
        imagelayer.visible = false;
    else
        imagelayer.visible = true;
       
    // toggle also the plugin layer
    krpano.set("plugin.visible", imagelayer.visible);
}

function toggle_krpano_area():void
{
    var area:Object = krpano.get("area");
   
    // just toggle between two sizes
    if (area.x == 20)
    {
        area.x      = 0;
        area.y      = 0;
        area.width  = "100%";
        area.height = "100%";
    }
    else
    {
        area.x      = 20;
        area.y      = 20;
        area.width  = 400;
        area.height = 300;
    }

}
Last edited by ivanov014 on Mon Aug 06, 2012 9:42 pm, edited 1 time in total.

User avatar
gkaefer
Member
 
Posts: 3355
Joined: Tue Jun 09, 2009 1:01 pm
Location: Salzburg

by gkaefer » Mon Aug 06, 2012 9:57 pm


no avatar
ivanov014
New member
 
Posts: 2
Joined: Mon Aug 06, 2012 9:21 pm

by ivanov014 » Tue Aug 07, 2012 9:38 pm

thx gkaefer, unfortunately this post did help..

i haven't found a proper way to load a a panotour swf into another flash movie..

Would you have any solution for us. ?


Return to Panotour bugs & discussion 1.8

Who is online

Users browsing this forum: No registered users and 1 guest