Forums  

Go Back   Forums > Talk > General FPP Discussion

Reply
 
Thread Tools Display Modes
  #1  
Old 10-15-2007, 02:06 PM
psychospiller psychospiller is offline
Junior Member
 
Join Date: Jul 2007
Posts: 8
Downloads: 0
Uploads: 0
Default Timer parameters

Can someone provide me with a detailed list of the parameters used in the timer command, eg.

timer+=1,2000,,functionA;

I understand that this will run functionA in two seconds, but what does the initial '1' mean and what can be placed between the ',,'

Also is it possible to use the timer command multiple times in a single function, but without calling more sub routines for example :

currently I have to do this

Code:
timer+=1,1000,,functionA;

functionA="
pano.zoom=3,1000;
timer+=1,1000,,functionB;
"
is it possible to do something like this:

Code:
timer+=1,1000,,functionA;
timer+=1,1000,,functionB;
timer+=1,1000,,functionC;
I can never seem to get the calls to functionB and C to work in this sample
Reply With Quote
  #2  
Old 10-15-2007, 03:37 PM
fbii fbii is offline
Junior Member
 
Join Date: Sep 2007
Location: Pacific Northwest US
Posts: 21
Downloads: 6
Uploads: 0
Default

Can someone provide me with a detailed list of the parameters used in the timer command, eg.

psychospiller,
I wish that I could. But, it seems that the only use this timer is for is as a pause followed by a shift to a new function. I have searched the help files and can't come up with anything else. However, I just use 'timer=1,1000,,newfunction'. Doesn't seem to matter about the += or =.

I can never seem to get the calls to functionB and C to work in this sample

Open the html file 'hotspots.html' and search for "goTimer". It's under pano object parameters - onKeyPress. There he shows a number of functions he called sequentially by timer. Hope this helps a little.

fritz

Last edited by fbii; 10-15-2007 at 03:38 PM. Reason: spelling
Reply With Quote
  #3  
Old 07-31-2008, 06:19 AM
ubiquity's Avatar
ubiquity ubiquity is offline
Junior Member
 
Join Date: May 2008
Posts: 18
Downloads: 0
Uploads: 0
Default

I'm wondering what can be placed between the double commas as well. There seems to be no documentation on it.

As for your other question, I believe the '1' is to activate or set the timer to 'true'. The documentation in the Hotspots tutorial says the default value of timer=0. Here is what it says:


timer is a variable linked to no one appearance object

Use it for your own needs, for example, to create pauses between actions:

onClick="scale=5; timer+=1,10000,,scaleBack" scaleBack="scale=1" (increase the scale of the object to 5 and scales it back to 1 after 10 seconds)

Default value is 0.



I've been told that you can cancel a timer by setting timer=0; but I have tried and it didn't work for me using the following code. I click the pano before the time has elapsed yet the pano completes the pan. Does anybody know how to actually kill the timer?


<global

onStart = "
timer+=1,1500,,global.panToHome
"
panToHome="
pano.pan=-10,1000,easyIn
"
>

<pano
onPress="timer=0"
/>

</global>

Reply With Quote
  #4  
Old 07-31-2008, 03:27 PM
cheathamlane cheathamlane is offline
Senior Member
 
Join Date: Mar 2007
Location: California, USA
Posts: 773
Downloads: 0
Uploads: 0
Default

Hi there:

ubiquity, I responded to your commas question in your other post:
http://flashpanoramas.com/forum/showthread.php?t=1628

The timer function uses the same syntax as other tweens.

As for your onPress event not getting called -- I generally put that in the <global> element rather than in <pano>, and that works for me.

There's a short tutorial on making a simple auto-presentation (which includes an explanation of the tween syntax); You might also look at the XML for the example on the front page of my site, which has a more complex auto-presentation which involves use of the timer throughout. Search specifically for "goTimer" and/or "stopTimer".

HTH!
__________________
Patrick
http://patrickcheatham.com

Last edited by cheathamlane; 07-31-2008 at 03:35 PM.
Reply With Quote
  #5  
Old 08-01-2008, 01:14 AM
ubiquity's Avatar
ubiquity ubiquity is offline
Junior Member
 
Join Date: May 2008
Posts: 18
Downloads: 0
Uploads: 0
Default

Thanks again cheathamlane!

It turns out that all I needed to do was add 'global.' to kill the timer.

global.timer=0

Now I'm successfully canceling the timer!

As far as the ‘double comma’ question, I believe I see what you’re saying now. I’m testing with the line below:

timer+=1,1500,elastic,global.panToHome,global.time r=0

So, if I understand this correctly, when the timer is finished, the panToHome function will run. If user interaction , like a mouse click, occurs it will cancel the timer via global.timer=0.

I tested the code and it works; but I still don’t understand what can be done between those commas. Tweening can only be detected visually and wouldn’t be relevant in above line of code.

So I tried this:

onStart="
timer+=1,1500,bounce,global.panToHome,global.testF unction;
"
panToHome="
pano.pan=-10,1000,easyIn;
"
testFunction="
pano.tilt=90,1000;
"


I thought that maybe when the timer was interrupted and testFunction was activated, the bounce tween would be applied to the tilt animation of testFunction. That’s not what happened. It ran with the default tween.

Can you come up with a scenario where tweening could actually be used in a timer?
Reply With Quote
  #6  
Old 08-01-2008, 01:50 AM
cheathamlane cheathamlane is offline
Senior Member
 
Join Date: Mar 2007
Location: California, USA
Posts: 773
Downloads: 0
Uploads: 0
Default

Woohoo!

You're welcome...

Yeah, I think you're absolutely right -- there's no real reason you'd want a tween on your timer since the timer isn't a visual thing (and it doesn't affect functions that follow). But, it's the syntax Denis is using.

If you look at the "Anatomy of a plugin" tutorial over at flashpanos.com, you'll see the "setAttribute" function. This function takes the tween syntax verbatim from the FPP XML, and must be the default function for handling calls from the FPP XML.

So, in the case of timer, Denis's setAttribute is probably just ignoring the tween aspect of it.

Quote:
Originally Posted by ubiquity View Post
So, if I understand this correctly, when the timer is finished, the panToHome function will run. If user interaction , like a mouse click, occurs it will cancel the timer via global.timer=0.

Yes, but!... I have run into issues with having something like "global.timer=0" at the end of a tween/timer sequence.

So, rather than this:

Code:
timer+=1,1500,elastic,global.panToHome,global.timer=0
It's probably better to use something like (pseudo-code alert):


Code:
<spot id="myspot"

onclick="timer+=1,1500,,global.panToHome,myspot.myFunction"

myFunction="global.timer=0"

/>
Cheers,

Patrick
__________________
Patrick
http://patrickcheatham.com
Reply With Quote
  #7  
Old 10-31-2008, 01:13 PM
congregate congregate is offline
Junior Member
 
Join Date: Feb 2008
Posts: 6
Downloads: 0
Uploads: 0
Default

Hi cheathamlane,

I have tried your solution:

Code:
<spot id="myspot"

onclick="timer+=1,1500,,global.panToHome,myspot.myFunction"

myFunction="global.timer=0"

/>
however, it doesnt reset the timer. Any idea why?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 07:34 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.