PDA

View Full Version : Reading and Using Hotspot Values


thegoodbus
01-06-2011, 02:48 PM
I have a project where, onClick, I would like to read the pan and tilt of a hotspot and change the pan and tilt of the camera to those values. How do I accomplish this?

I know that XML cannot declare and store variables, and I have investigated the plugins to see if any might help me out. Tommy's panologic and commander plugins interested me for a while, but I could not figure out a creative way to get around the structure of those plugins (which is when x, do y, instead of what I need - what is x, now make y=x).

The probable solution is a plugin that reads the value of something in FPP (the pan and tilt of a hotspot in this case) and then instructs FPP to change something different to that value (in this case the pan and tilt of the camera). Has anyone done this before?

I read a lot on the forums to see what it would take for me to figure out how to write this in Flash (I have access to Flash CS4), but I do not look forward to spending valuable days right now learning this technique (I do not yet know AS3).

Is there a technique in XML or an existing plugin that accomplishes this feature? If not, could someone point me to some helpful AS3 code that will help me build a plugin?

I really appreciate all that you do to help on this forum. I have waited a while before posting this question to be sure I really couldn't find the answer elsewhere or create a workaround of my own. Thank you very much.

uudu
01-06-2011, 03:49 PM
Do I understand you right? You want the pano turn to some certain point when visitor click on hotspot?
In this case add to your hotspot
onClick="pano.pan=90,800; pano.tilt=30,800"

allSaints
01-07-2011, 10:03 AM
When I read your post, I remembered an addition I was going to make to the panologic plugin but then forgot all about. It concerned the possibility to use the plugin meta operands in your FPP commands.

So, I made the the update, and it might be of interest to you that you can now (amongst many other things) very easily pan to any hotspot - without knowing its position, but just its id. I also made a test page here (http://wirestam.com/panos/Flash/panologic/functest4.html).

Of course - like uudu says - you use the pano.pan and pano.tilt settings, but I guess you knew that already. As you have looked at the possibilities in panologic, I guess you understand this plugin function:
<function name="goSpot">
<![CDATA[ $command(pano.pan=$Myspot.pan,3000;pano.tilt=$Mysp ot.tilt,3000) ]]>
</function>
That's all you need to pan to a spot (in this case named Myspot).

All the other hotspot attributes and FPP variables that you can access with the meta operands are of course also possible to use in the FPP command string.

You can email or pm me if you want further information.

Tommy

thegoodbus
01-10-2011, 07:59 PM
Thank you very much for your replies.

Uudu, yes, you are right that I just want to change the pan and tilt, but the difference in my request is that rather than specifying a pan of 90 and tilt of 30 onClick, I want to read the current pan and tilt of a hotspot and then change the camera view to that. I can type these individual numbers, but the development time would be shorter and my hair would remain longer if I could just read the current data.

Tommy, this is exactly what I was looking for. I consider this issue SOLVED (I love saying that). You have really exceeded my expectations with that reply and made my day.

I apologize, everyone, for the slightly delayed response. I was wondering if anybody had seen my question because I hadn't received any notifications from my subscription, but just now I found that I had an old email account registered with this forum. That issue too is now fixed. Thank you, FPP community!

franchtech
06-01-2011, 03:38 AM
Hi Tommy,

I use FPP since a few. Your plugins are really splendide.

I've studies in detail panologic plugin. It give many possibilities for my applications.

One thing to know and important for me:
Can we use panologic.xml under a text format but not a file?

My objective is to define dynamically the position of a hotspot (a variable) and move it into this position.
For example, create the xml content by Javascript then pass it to panologic...

Regards,
Robert

allSaints
06-02-2011, 11:49 AM
Thanks Robert,

well, I have added the xmlData=<?xml... parameter, that you can use instead of "xmlFile=...".

It is of course used in the same way, i.e. "external.panologic.xmlData=...", but as this is an FPP command, it is parsed by FPP and must not contain characters like .;" or newline. So, the xml string must be escape-coded (NOT html-encoded), and will be unescaped again by the plugin.

There is no ExternalInterface built into the plugin, so you have to go via FPP from your JavaScript function.

The new panologic version is 1.5 (http://wirestam.com/panos/Flash/plugins/panologic.html).

Tommy