You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Saturday, January 31st 2009, 11:21pm

How to discard a delayedcall event?

I would really appreciate a little assistance with this, if someone knows an answer.

I want to have a pano turn/zoom to a certain location a number of seconds after it loads. I've managed this using delayedcall in the onstart event, like this:

onstart="action(startview);
delayedcall(8, action(turnview); );"

The 'startview' action that's kicked into life by the onstart event shows a particular view location and scale. The 'turnview' action that's invoked 8 seconds afterwards by delayedcall() turns the pano to a different position and scale.

The reason for having this delayed event is to help make people realise that this is not just a basic photo; to get their attention enough, with luck, for most people to then see the info about clicking and dragging (there's a small note beneath the image) or simply try dragging it themselves.

HOWEVER - it is actually a bit annoying if you've already started looking around the pano for it to suddenly start turning to a different view point. My ideal solution would be some kind of 'flush events' call that killed off anything that's been set to be pending. Is there anything that can do this?

Using "oninterrupt( stopall() )" does stop events that are in the immediate queue (such as a consecutive series of tweens) but it doesn't stop a delayedcall event from kicking in later on, even if the 'timer' was started within the interrupted event.

Does anyone see a way to do this? Or perhaps achieve the same sort of effect in some other way?

k (fairly new to KRPano but loving it)

Graydon

Professional

Posts: 614

Location: Texas

Occupation: Industrial gas turbine services.

  • Send private message

2

Sunday, February 1st 2009, 11:17pm

maybe you could use an "if action"... it came in b4 and can be found here... http://www.krpano.com/forum/wbb/index.ph…ID=120&pageNo=2 near the bottom.

check to see if the hlookat or vlookat is still set to the original values... if so, then your trueaction would be to "turnview".

Your delayed call would reference an action that checked the IF condition... the IF condition would cal the turnview if true... or nothing if false and go on.

I haven't tested or tried anything using IF... so this is just speculation.

Graydon

ClearTours

Beginner

Posts: 18

Location: Naperville, IL USA

Occupation: Architectural Photographer

  • Send private message

3

Monday, February 2nd 2009, 6:16am

Here's the fix..a bit of a hack but it works.

Keith,

This one was a bit of a puzzle, but try this in your krpano.xml file... It works for me using krpano 1.0.7 and I think it does what you're looking for.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
<krpano version="1.0.7">
    <display ....  />
    <image.....   />
    <view...  />

     <autorotate enabled="true" horizon="0" accel="10"/>
     <plugin visible="true" enabled="true" handcursor="false" capture="false" name="clickcheck" url="blank10x10.png" width="100%" height="100%" onClick="action(norotate);" />
     <action name="norotate">
          set(autorotate.enabled,false);
          removeplugin(clickcheck);
     </action>
</krpano>


blank10x10.png is just an empty image file with a transparent background that is stretched across the entire krpano instance as a plug-in. As soon as the plug-in is clicked, it disables the autorotate and unloads itself. You need to configure autorotate for your delay and the point to rotate to.

Hope this helps

Lee

---

Lee Evans
levans@cleartours.com

4

Monday, February 2nd 2009, 10:26am

Hi,

an interesting request
currently there is no direct way to stop a delayedcall(),
it can be done only via hacks like the one from ClearTours (btw - good idea )

you could use the same hack also to store a user defined value (e.g. "doturnview")
in the onclick event, and check this value in the delayedcall action using the if() function,

e.g.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
<krpano onstart="set(doturnview,yes);
                 delayedcall(8, if(doturnview == yes, action(turnview)); );">

<plugin visible="true" enabled="true" handcursor="false" capture="false" name="clickcheck" 
        url="blank10x10.png" width="100%" height="100%" 
        onClick="action(norotate);" />

<action name="norotate">
    set(doturnview,no);
    removeplugin(clickcheck);
</action>

</krpano>


best regards,
Klaus

5

Monday, February 2nd 2009, 1:37pm

Great bit of script, Klaus! That does the job very well. (And I've also learned a bit more about things as I got it set up, which is always a bonus.)

I look forward to the possibility of a simpler way to 'flush' a directcall and maybe other things, but in the meantime I'll be testing and implementing this with a big grin on my face.

Thanks!

k

6

Monday, February 2nd 2009, 1:59pm

Thanks again - see how it works at http://www.panoramaphotographer.com/fest…ingdaytime.html

As soon as possible (immediate onstart event) it rotates from the equirect center to a starting point with the large tree on the left, then if there's no interaction after 8 seconds it rotates to put the tree trunk on the right.
This is mainly to show the festival organisers at the moment, in preparation for the Glade 2009 festival. But while doing this I also wanted to explore ways of getting the viewer's attention, showing that it isn't a simple photo but also getting across that it isn't just a video either. I'm not sure this is totally successful, but I think it helps.

k (rather happy!)