Blinking Ticks!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Blinking Ticks!
Hi all,
I have a button that I would like to flash between two colors as the player it controls reaches the last 5 seconds of the file being played.
I'm sure I can do this with the 'blinkrate' but the dictionary isn't completely clear how to use the command...
Any clues out there?
Best
D
I have a button that I would like to flash between two colors as the player it controls reaches the last 5 seconds of the file being played.
I'm sure I can do this with the 'blinkrate' but the dictionary isn't completely clear how to use the command...
Any clues out there?
Best
D
So, it's a big Salami... Just take it one slice at a time.
Docs?!!!
Hi Klaus,
I started writing code for the first time in my 50 years on this earth when I bought Runtime just over a month ago. I've had to start from a very real blank canvass.
I've tried very hard not to raise queries on this forum unless I can't find the answer within the material I have to hand. Things that may be clear and straight forward to the more experienced programme developers aren't always so obvious to the beginner.
On this occasion I have searched the dictionary where there is an entry that I don't quite understand, the user guide where a search showed no mention of the word "blinkrate", I searched the resource centre, the tutorials that I have and the web sites, I even did a search on Google and nowhere have I found any more enlightening information about "blinkrates".
So the answer to your rather glib response to my question is this...
What Docs?
Ithankyou
D
I started writing code for the first time in my 50 years on this earth when I bought Runtime just over a month ago. I've had to start from a very real blank canvass.
I've tried very hard not to raise queries on this forum unless I can't find the answer within the material I have to hand. Things that may be clear and straight forward to the more experienced programme developers aren't always so obvious to the beginner.
On this occasion I have searched the dictionary where there is an entry that I don't quite understand, the user guide where a search showed no mention of the word "blinkrate", I searched the resource centre, the tutorials that I have and the web sites, I even did a search on Google and nowhere have I found any more enlightening information about "blinkrates".
So the answer to your rather glib response to my question is this...
What Docs?
Ithankyou
D
So, it's a big Salami... Just take it one slice at a time.
when a long time user of rev says "docs" he always means the dictionary. it used to be the only documentation place, and "docs" kinda stuck for us old timer. It's also the one single place where you'll find every single term toroughly documented, so whenever you see a rev-term that doesn't tell you much, a visit to the dictionary is in order.
so go to the help menu and choose dictionary, or klick the dictionary button of the icon bar (the last one at the right end) . then enter "blinkrate" (no quotes) in the search/filter field, and read the entry on it. also make sure to check out the see also links, often you'll find similar terms or even alternatives that might fit what you want to do better.
so go to the help menu and choose dictionary, or klick the dictionary button of the icon bar (the last one at the right end) . then enter "blinkrate" (no quotes) in the search/filter field, and read the entry on it. also make sure to check out the see also links, often you'll find similar terms or even alternatives that might fit what you want to do better.
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
"The Docs" usually refers to the Rev Dictionary, available in the Rev IDE by picking the icon in the toolbar at the far right.
"blinkRate" is something I never looked at before, and I would have been rather surprised if it had done what you need - and as I suspected, looking at the Docs info it seems that it just adjusts the rate of the flashing insertion point cursor.
To do this I think you would need to look up about callbacks in the player object (see here for some info http://www.runrev.com/developers/tutori ... callbacks/ ) where you can set a trigger at 5 seconds from the end of the player to send a message to the button,say(5000 being the length of time in milliseconds that the button should blink).
Then in the button script you would have a handler for the messageIf you set a custom Property in the button for the foreground and background colours then it will use those values to swap them. There are plenty of other ways Rev lets you use to skin the cat, but this was the first that struck me without thinking too hard.
HTH
"blinkRate" is something I never looked at before, and I would have been rather surprised if it had done what you need - and as I suspected, looking at the Docs info it seems that it just adjusts the rate of the flashing insertion point cursor.
To do this I think you would need to look up about callbacks in the player object (see here for some info http://www.runrev.com/developers/tutori ... callbacks/ ) where you can set a trigger at 5 seconds from the end of the player to send a message to the button,say
Code: Select all
send "colourBlinker 5000" to button "btnBlinker"
Then in the button script you would have a handler for the message
Code: Select all
on colourBlinker pCount
if pCount > 0 then
put the cCycle of me into tCycle
switch tCycle
case false
set the backgroundColor of me to the cForegroundColour of me
set the foregroundColor of me to the cBackgroundColour of me
break
default
set the backgroundColor of me to the cBackgroundColour of me
set the foregroundColor of me to the cForegroundColour of me
end switch
set the cCycle of me to not the cCycle of me
subtract 500 from pCount
send "colourBlinker pCount" to me in 500 milliseconds
else
set the backgroundColor of me to the cBackgroundColour of me
set the foregroundColor of me to the cForegroundColour of me
end if
end colourBlinker
HTH
Mnay thanks!
Hi guys,
Okay, thanks very much for that; BvG, I'll get the hang of the terminology as I go along but thank you for clarifying that.
Sparkout; Thanks for that, I'll be building that into my programme today!
Klaus; you've taught me much in a short time, so I'm happy I can teach you something like a new word! If you want to know what it means, there's always the dictionary!
Ithankyou
D
Okay, thanks very much for that; BvG, I'll get the hang of the terminology as I go along but thank you for clarifying that.
Sparkout; Thanks for that, I'll be building that into my programme today!
Klaus; you've taught me much in a short time, so I'm happy I can teach you something like a new word! If you want to know what it means, there's always the dictionary!

Ithankyou
D
So, it's a big Salami... Just take it one slice at a time.