To get this alternating i applied an expression to the opacity of the image:
AM - ([HOUR_0_23] <12? 0:-95)
PM - ([HOUR_0_23] <12? -95:0)
In the preview when you drag through timeline they interchange exactly as intended and initially on running on device it seems to display, yet the next day it gets dropped completely. When re selecting the watch face it pulls through again and then drops next day again.
Any thoughts on what i have done wrong here. Appreciate it could be simpler to just have one button with AM/PM displayed, but it looked very cool having them alternate and be close to transparent when not that time of day.
It shouldn’t matter, but you might try using the IS_AFTNOON (AM =0, PM =1)tag instead, and switch around the opacity values to positive numbers.
AM would become ([IS_AFTNOON]==0?100:5)
PM is then ([IS_AFTNOON]==1?100:5) or ([IS_AFTNOON]==0?5:100)
don’t forget to change the default opacity for the image to 0
Using this tag also has the benefit of working as intended regardless of 12 or 24 hour format. As said, it shouldn’t matter but I’ve solved “buggy” problems like this by coming at the problem from a slightly different angle.
Glad I could help. My gut says your code will work as intended with the negative opacity values, I suspect that the original expression failed when the hours tag rolled over, perhaps a flag isn’t getting set/cleared?
Another idea to try if you feel like playing with the code some more: try your original expression but use the [HOUR_1_24] tag instead of [HOUR_0_23]. All three variations of tags ([HOUR_0_23], [HOUR_1_24] and [IS_AFTNOON] should work with the appropriate tweaks to the ternary conditionals, so if one tag combo works and another doesn’t it might point to a bug in the latest WFS release.
I’m sure a more experienced member can shed some light on this, I for one am looking forward to your results!
Note the opacity value (as about every values with expression field) is composed of two numbers. The first is there by default before you start playing with tags
plus the result of inserted expression. So if you leave the default 100 in place, you have to adjust your expression so that it counts with it, or you set it to 0 and get both values just from the expression it self.