Just a quick question that would save me a lot of repetition. Tile A is pressed and pops up and is pressed again and pops back down, great! I want all the tiles to do the same (in reality I have lots and lots of tiles that need to do this). I really don’t want to have to repeat a timeline for each tile and I was wondering if there was an easy way to do this with either a custom behaviour or a simple JS function. My small brain can’t figure it out but I was wondering if someone out there can solve this to save me hours of repetitive awfulness. I have attached a hype doc to illustrate my conundrum. Thanks in advance! tile pop.hype.zip (10.5 KB)
Hi, why don´t you use Symbols? Just add the ‘button pop’ timeline to a symbol, add the ‘continue symbol timeline’ action and continue the timeline by clicking the symbol. You can add the letter referring to each symbol-instance (or do other symbol specific things…) by calling a little javascript onLoad of the symbol (using the HTML-Attribute feature)
oh hang on. I’ve hit a problem as I needed the tiles to have different images on them rather than text - sorry, I know this was not clear in my example. Is there an easy solution to this?
Well, without having tested … you can load images dynamically (look at this thread e.g.) You can set the url to the image as an HTML-Attribute (like I did it with the letters)
I added the background images to the library. ‘data-picture’ is the name of the picture to load:
"${resourcesFolderName}/" + symbolInstance.dataset.picture);
… is the combination of path to the resource folder and the picture name (data-picture in HTML-Atributes)