Image-stitching and virtual tour solutions My account Updates
It is currently Tue Oct 21, 2014 6:33 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Aug 06, 2012 9:41 pm 
Offline
New member

Joined: Mon Aug 06, 2012 9:21 pm
Posts: 2
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 on Mon Aug 06, 2012 9:42 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 06, 2012 9:57 pm 
Offline
Member
User avatar

Joined: Tue Jun 09, 2009 1:01 pm
Posts: 3340
Location: Salzburg
dont know if following post is a help for you...
http://www.kolor.com/forum/t11067-loading-the-autopano-swf-externally-inside-flash
Georg

_________________
pages: gigapixel.at - jedermann.at - My Equipment


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 07, 2012 9:38 pm 
Offline
New member

Joined: Mon Aug 06, 2012 9:21 pm
Posts: 2
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. ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group