PDA

View Full Version : How do you pan to specific hotspot?


mpbiehn
02-24-2008, 05:09 PM
I'm trying to figure out how to goto a specific hotSpot. I'm using the embedPano and have a button on the stage. When a user clicks a button I want to pan to a specific hotspot. I'll have multiple buttons that will each goto a different hotspot.

The code "panorama.pano.panKey = 40;" is used to pan but it seems the position changes so the next button doesn't pan correctly.

On one of the sites I found what was looking for, however, the example is executing javascript. See below.

livePanoExecute("pano.qualityStatic=low;pano.pan=-55,4000,elastic;pano.tilt=-30,2100,elastic;pano.zoom=1,2000,elastic,restoreQu ality;")

What's the equivalent AS3 code for pano.pan=-55,4000,elastic? Is there an easier way to pan to a specific hotspot?

Thanks.
Matthew.

cheathamlane
02-24-2008, 06:07 PM
Hey Matthew:

Is your issue with getting the pano to pan at all? Or is it that the hotspot's pan position in "pano A" is different from the hotspot's pan position in "pano B"?

If the latter, then you may need to check for "pano.panoName" (or similar) and run a switch or if/else; depending on the panoName property (ie, which pano is currently being viewed), your button click event can send the pano to the appropriate pan position.

?

zleifr
02-24-2008, 06:07 PM
The simple answer to what's the AS3 code to do most anything in FPP is to use hotspots.execute("fpp command here");

The only trick to using hotspots.execute() is getting a link to the hotspots plugin object. It is panorama.externals.hotspots, BUT it will not be defined until slightly AFTER you load pano.swf, so you have to write a bit of code to check to see if it is defined, and if not, wait and check again.

There are a number of examples of this code floating about on the forum here, or in the open source plugins written by Denis.

Zephyr

mpbiehn
02-24-2008, 09:19 PM
Thanks for the reply.

I can't get the pano to pan at all.

I also tried tracing out "panorama.pano.panoName" and I get an error. How can I tell if I'm dealing with one or more pano? I think I'm only dealing with one pano. I just want to pan to one of the hotspots in the pano. Does this make since?

The link to the example is http://flashpanoramas.com/blog/2007/05/23/add-some-life-to-panoramas/. Below the example is a link to the photos, after clicking the link the pano pans to the photo hotspot. I'm trying to do this using an embeded pano with action script versus thru External Interface.

Matthew

mpbiehn
02-24-2008, 09:27 PM
Sweet. I just got the hotspots.execute to work using the same code (showPhoto()) from the example I posted above.

Thanks for the help.