Page 1 of 1

[buttons problem] API work after click panorama. :/

Posted: Mon Jul 23, 2007 7:50 pm
by danio987
Hi.

I have very sirous problem with my API.
When I load a swf with pano to container everything work perfect, but when i trie to load next panorama first what i must to do is click on pano wich I loaded previously next press any button on map. And so on...

This is part of code responsible for loading swf in this flash:

Code: Select all

on (release) {
	
	
	// Create container movieclip
var vr:MovieClip = _root.createEmptyMovieClip("vr", 2);
// prevent access to "real" root
vr._lockroot=true;

// Create a Movieclip loader
var myLoader = new MovieClipLoader();
var myListener = new Object();

myListener.onLoadStart = function() {
// Set the dimentions and position of the pano
  vr.window_width=600;
  vr.window_height=300;
  vr.window_x=200;
  vr.window_y=6;
// change initial viewing parameters
  vr.pan=300;
  vr.tilt=10;
  vr.autorotate = 1;
  vr.autorotate_delay = 20; 
};


// add the Listener
myLoader.addListener(myListener);

// ... and finally load the pano!
myLoader.loadClip("teren/1.swf", vr); 


	


}
It is similar problem that i found here http://www.pano2qtvr.com/forum/viewtopi ... ns+problem

Here is my presentation http://budstol-holding.pl/panel_pop3.swf

Ps.If you have any questions about other parts of code please ask. :)
Ps2.Sory for my english,

Posted: Tue Jul 24, 2007 3:40 am
by thomas
I guess I figured this out now. This is a focus issue. The panorama takes the focus to capture key strokes. After loading (in the onLoadInit()) just give the focus to another element for example the entire root. To do this call:

Code: Select all

Selection.setFocus(_root); 
I haven't tried this out, because I can not reproduce this effect on my Falsh Development machine but I hope this works/helps.

Posted: Tue Jul 24, 2007 8:05 pm
by danio987
In fact this is quite briliant idea, but even i set it on end load script, like this

Code: Select all

Selection.setFocus(_root);
It dosen't work.
Second aproach

Code: Select all

this.panel.onLoadInit () = function () { 
Selection.setFocus(_root); }
And third

Code: Select all

	myListner.onLoadInit = function(panel:MovieClip){
		Selection.setFocus(_root.panel);}
Maby i just don't know how and where place this "function" properly.

Posted: Thu Jul 26, 2007 8:52 pm
by Martin Garcia
hi man i think both have the same problem. i make something i change the vr._lockroot = false; and woks fine, but the problem in my case is the position of the vr...

goood luck

Posted: Mon Aug 20, 2007 10:49 pm
by Brian
I had both the positioning problem AND the problem Thomas describes as "focus". Actually, when I told him about my site and these issues, he released v1.6.5 which dealt with the positioning issue, and then v1.6.6 which dealt with the "focus" problem. v 1.6.6 also sured a problem for me where the controllewr I created the Flash panos with didn't appear.

I think I knowe what Thomas means by focus, but in the end I had to make NO code changes, his two successive versions dealt wioth issues that arose somewhere in a previous 1.6 version but weren't there in 1.5.

I think all these issues were related to one area of how Thomas's GUI creates the vr. Try v1.6.6 if you haven't already!