You are not logged in.

> The forum rules have been updated. Please take a moment to read them.


#1 2012-08-06 22:41:37

ivanov014
New member
Registered: 2012-08-06
Posts: 2

Load embeded panotour swf into another flash movie

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:

/*
    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 (2012-08-06 22:42:31)

Offline

 

#2 2012-08-06 22:57:41

gkaefer
Member
From: Salzburg
Registered: 2009-06-09
Posts: 2670
Website

Re: Load embeded panotour swf into another flash movie

dont know if following post is a help for you...
http://www.kolor.com/forum/t11067-loadi … side-flash
Georg

Offline

 

#3 2012-08-07 22:38:37

ivanov014
New member
Registered: 2012-08-06
Posts: 2

Re: Load embeded panotour swf into another flash movie

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. ?

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson