removeChild(loader);
Panorama Flash API
-
- Posts: 3
- Joined: Mon Aug 27, 2007 11:16 am
The pano is added to the stage. However, I managed to fix it by removing the loader instead of 'vr'.
Crackers dont matter
HI... i need some help i realse a Flash API that contains about 32 vr. i use pano2vr 1.6.6.. i want to do one think i need to add controllers to the application... with out have to process the vr again adding the controller from pano2vr... just add some code and some buttons to my proyect
Thanks
Thanks
What do you mean with "pan scale"? The current pan angle? If so, you can query it with vr.pano.getPan().vopros wrote:Hello. How to returns the current pan scale? I need compensate modification of the loaded clip.
MfG, Thomas
Hello
Is it posible to read in flash all hotspots from loaded 360 swf ?
Something like getAllOriginalHotspots(panoID) or clearAllOriginalHotspots(panoID).
I want to do as follows:
1. Create pano with hotspots in pano2qtvr
2. Then load it to main movie
3. Get (read) all positions of hotspots created in pano2qtvr
4. substitute original hotspots with my custom movieclips on given positions.
Big thanks for your answer.
Is it posible to read in flash all hotspots from loaded 360 swf ?
Something like getAllOriginalHotspots(panoID) or clearAllOriginalHotspots(panoID).
I want to do as follows:
1. Create pano with hotspots in pano2qtvr
2. Then load it to main movie
3. Get (read) all positions of hotspots created in pano2qtvr
4. substitute original hotspots with my custom movieclips on given positions.
Big thanks for your answer.
This is currently not possible, but I added it to the wish list.atreiu wrote: I want to do as follows:
1. Create pano with hotspots in pano2qtvr
2. Then load it to main movie
3. Get (read) all positions of hotspots created in pano2qtvr
4. substitute original hotspots with my custom movieclips on given positions.
MfG, Thomas
Hello again
I cannot manage _visibility of movieclips which were added with addHotSpot.
I only cannot manage it when the pano is not moving (while its pressed by user).
What I do is:
1. Create movieClip
var hsMovie:MovieClip=_root.attachMovie("pa","hsMovie"+idx,_root.getNextHighestDepth());
2. assign some behaviour to them:
hsMovie.onEnterFrame = function(){
this._visible=this.hitTest(this._parent.vr_);
}
3. add movie to pano as hotspot.
(in the loop)
vr.pano.addHotspot("hs"+idx,this.childNodes[idx].attributes.wa,this.childNodes[idx].attributes.ha,hsMovie);
In the example code this problem was solved with loading "border" higher than hotspots. I just cannot use such solution. -> I thought I solve it as above. My hitTest works fine, if I trace _visible it is same as hitTest, but on the screen there is no effect. Even if I put in point 2 something like this:
hsMovie.onEnterFrame = function(){
this._visible=0);
}
the hotspots are always visible. Only if my pano is not moving then my onEnterFrame works fine.
For the moment I use _alpha parameter but maybe anybody faced this issue before?
Thanks for the answer.
I cannot manage _visibility of movieclips which were added with addHotSpot.
I only cannot manage it when the pano is not moving (while its pressed by user).
What I do is:
1. Create movieClip
var hsMovie:MovieClip=_root.attachMovie("pa","hsMovie"+idx,_root.getNextHighestDepth());
2. assign some behaviour to them:
hsMovie.onEnterFrame = function(){
this._visible=this.hitTest(this._parent.vr_);
}
3. add movie to pano as hotspot.
(in the loop)
vr.pano.addHotspot("hs"+idx,this.childNodes[idx].attributes.wa,this.childNodes[idx].attributes.ha,hsMovie);
In the example code this problem was solved with loading "border" higher than hotspots. I just cannot use such solution. -> I thought I solve it as above. My hitTest works fine, if I trace _visible it is same as hitTest, but on the screen there is no effect. Even if I put in point 2 something like this:
hsMovie.onEnterFrame = function(){
this._visible=0);
}
the hotspots are always visible. Only if my pano is not moving then my onEnterFrame works fine.
For the moment I use _alpha parameter but maybe anybody faced this issue before?
Thanks for the answer.
The visibility is also controlled by the panorama because otherwise it would show up again if you are looking in the opposite direction. A solution with _alpha should work.atreiu wrote:I cannot manage _visibility of movieclips which were added with addHotSpot.
I only cannot manage it when the pano is not moving (while its pressed by user).
MfG, Thomas
Ok thanks.
I guess handling _alpha is not enough... If MovieClip has some behavior attached (onPress, onRollOver or so on) those actions will block elements beneath.
If anybody faces same problem I solved it like this:
I guess handling _alpha is not enough... If MovieClip has some behavior attached (onPress, onRollOver or so on) those actions will block elements beneath.
If anybody faces same problem I solved it like this:
Code: Select all
hsMovie.onEnterFrame = function(){
if(!this.hitTest(PanoArea)){
this._alpha =0;
delete this.onRelease;
delete this.onRollOver;
delete this.onRollOut;
}else{
this._alpha=100;
this.onRelease = someOnrelaseFunction;
this.onRollOver= someonRollOverFunction;
this.onRollOut = someonRollOutFunction;
}
}
And... I have another question:)
Since there is no possibility to read all positions of hotspots saved with pano2QTVR I created my own aplication were I can load flat 360-image and set some points (hotspots) and save it to database. I assumed that:
1. the center of the image is 0 pan and 0 tilt
2. the width of the image is 360 pan, and the height is 180 degree.
Basis on it I just use proportion to convert pixels to degrees.
This gives me approximate data because the image that I base on is flat. Generally it is ok but in some cases there is much misplacement.
The img beneath shows the point that I spot on my hotspot editor:
The img beneath shows the point that I receive in my application:
Is it possible that you tell me how can I better convert pixel (_x and _y) to pan and tilt?
Thanks.
Since there is no possibility to read all positions of hotspots saved with pano2QTVR I created my own aplication were I can load flat 360-image and set some points (hotspots) and save it to database. I assumed that:
1. the center of the image is 0 pan and 0 tilt
2. the width of the image is 360 pan, and the height is 180 degree.
Basis on it I just use proportion to convert pixels to degrees.
This gives me approximate data because the image that I base on is flat. Generally it is ok but in some cases there is much misplacement.
The img beneath shows the point that I spot on my hotspot editor:
The img beneath shows the point that I receive in my application:
Is it possible that you tell me how can I better convert pixel (_x and _y) to pan and tilt?
Thanks.
I use the following code to get the angles:
Where p.x is pan and p.y is tilt. You need to add the current pan an tilt angles.
Code: Select all
public function getPositionAngles(x :int,y :int):Point {
var d:Number;
var dx:Number;
var dy:Number;
d=rect.height/(2*Math.tan(fov.cur*Math.PI/360.0));
dx=(x-rect.width/2.0);
dy=(y-rect.height/2.0);
var p:Point=new Point();
p.x=180.0*Math.atan(dx/d) / Math.PI;
p.y=180.0*Math.atan(dy/Math.sqrt(dx*dx+d*d)) / Math.PI;
return p;
}
MfG, Thomas